From a41e5ca781072866207f62f2ecd9e33a124c0d1e Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Thu, 18 Jun 2015 21:01:06 +0100 Subject: [PATCH] Designate Dashboard now has it's own repo The dashboard has been moved to openstack/designate-dashboard, a new repo. Change-Id: I36dcfc7ac0446c8fe4c637892b2864c116528fdb Depends-On: Icd53afc063d3c7afbc04769285f7538cd27fdef7 --- contrib/designate-dashboard/CONTRIBUTING.rst | 17 - contrib/designate-dashboard/HACKING.rst | 4 - contrib/designate-dashboard/LICENSE | 175 ------- contrib/designate-dashboard/MANIFEST.in | 8 - contrib/designate-dashboard/README.rst | 41 -- contrib/designate-dashboard/babel.cfg | 1 - .../designatedashboard/__init__.py | 19 - .../designatedashboard/api/__init__.py | 1 - .../designatedashboard/api/designate.py | 174 ------- .../designatedashboard/dashboards/__init__.py | 0 .../dashboards/project/__init__.py | 0 .../project/dns_domains/__init__.py | 0 .../dashboards/project/dns_domains/forms.py | 478 ------------------ .../dashboards/project/dns_domains/panel.py | 26 - .../dashboards/project/dns_domains/tables.py | 222 -------- .../templates/dns_domains/_create_domain.html | 38 -- .../templates/dns_domains/_create_record.html | 25 - .../templates/dns_domains/_domain_detail.html | 32 -- .../templates/dns_domains/_record_detail.html | 36 -- .../templates/dns_domains/_update_domain.html | 36 -- .../templates/dns_domains/_update_record.html | 9 - .../templates/dns_domains/create_domain.html | 11 - .../templates/dns_domains/create_record.html | 11 - .../templates/dns_domains/domain_detail.html | 11 - .../templates/dns_domains/index.html | 11 - .../templates/dns_domains/record_detail.html | 11 - .../templates/dns_domains/records.html | 32 -- .../templates/dns_domains/update_domain.html | 11 - .../templates/dns_domains/update_record.html | 11 - .../dashboards/project/dns_domains/tests.py | 447 ---------------- .../dashboards/project/dns_domains/urls.py | 52 -- .../dashboards/project/dns_domains/views.py | 224 -------- .../enabled/_70_dns_add_group.py | 20 - .../enabled/_71_dns_project.py | 32 -- .../designatedashboard/enabled/__init__.py | 0 .../designatedashboard/exceptions.py | 29 -- .../tests/.secret_key_store | 1 - .../designatedashboard/tests/__init__.py | 0 .../designatedashboard/tests/base.py | 53 -- .../designatedashboard/tests/settings.py | 133 ----- .../tests/test_designatedashboard.py | 448 ---------------- .../designate-dashboard/doc/source/conf.py | 75 --- .../doc/source/contributing.rst | 4 - .../designate-dashboard/doc/source/index.rst | 24 - .../doc/source/installation.rst | 12 - .../designate-dashboard/doc/source/readme.rst | 1 - .../designate-dashboard/doc/source/usage.rst | 7 - .../designate-dashboard/openstack-common.conf | 6 - contrib/designate-dashboard/requirements.txt | 10 - contrib/designate-dashboard/setup.cfg | 46 -- contrib/designate-dashboard/setup.py | 30 -- contrib/designate-dashboard/test | Bin 2048 -> 0 bytes .../designate-dashboard/test-requirements.txt | 17 - contrib/designate-dashboard/tox.ini | 34 -- contrib/devstack/lib/designate | 10 +- contrib/vagrant/Vagrantfile | 8 + tox.ini | 2 +- 57 files changed, 16 insertions(+), 3160 deletions(-) delete mode 100644 contrib/designate-dashboard/CONTRIBUTING.rst delete mode 100644 contrib/designate-dashboard/HACKING.rst delete mode 100644 contrib/designate-dashboard/LICENSE delete mode 100644 contrib/designate-dashboard/MANIFEST.in delete mode 100644 contrib/designate-dashboard/README.rst delete mode 100644 contrib/designate-dashboard/babel.cfg delete mode 100644 contrib/designate-dashboard/designatedashboard/__init__.py delete mode 100644 contrib/designate-dashboard/designatedashboard/api/__init__.py delete mode 100644 contrib/designate-dashboard/designatedashboard/api/designate.py delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/__init__.py delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/__init__.py delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/__init__.py delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/forms.py delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/panel.py delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/tables.py delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_create_domain.html delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_create_record.html delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_domain_detail.html delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_record_detail.html delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_update_domain.html delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_update_record.html delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/create_domain.html delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/create_record.html delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/domain_detail.html delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/index.html delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/record_detail.html delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/records.html delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/update_domain.html delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/update_record.html delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/tests.py delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/urls.py delete mode 100644 contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/views.py delete mode 100644 contrib/designate-dashboard/designatedashboard/enabled/_70_dns_add_group.py delete mode 100644 contrib/designate-dashboard/designatedashboard/enabled/_71_dns_project.py delete mode 100644 contrib/designate-dashboard/designatedashboard/enabled/__init__.py delete mode 100644 contrib/designate-dashboard/designatedashboard/exceptions.py delete mode 100644 contrib/designate-dashboard/designatedashboard/tests/.secret_key_store delete mode 100644 contrib/designate-dashboard/designatedashboard/tests/__init__.py delete mode 100644 contrib/designate-dashboard/designatedashboard/tests/base.py delete mode 100644 contrib/designate-dashboard/designatedashboard/tests/settings.py delete mode 100644 contrib/designate-dashboard/designatedashboard/tests/test_designatedashboard.py delete mode 100755 contrib/designate-dashboard/doc/source/conf.py delete mode 100644 contrib/designate-dashboard/doc/source/contributing.rst delete mode 100644 contrib/designate-dashboard/doc/source/index.rst delete mode 100644 contrib/designate-dashboard/doc/source/installation.rst delete mode 100644 contrib/designate-dashboard/doc/source/readme.rst delete mode 100644 contrib/designate-dashboard/doc/source/usage.rst delete mode 100644 contrib/designate-dashboard/openstack-common.conf delete mode 100644 contrib/designate-dashboard/requirements.txt delete mode 100644 contrib/designate-dashboard/setup.cfg delete mode 100755 contrib/designate-dashboard/setup.py delete mode 100644 contrib/designate-dashboard/test delete mode 100644 contrib/designate-dashboard/test-requirements.txt delete mode 100644 contrib/designate-dashboard/tox.ini diff --git a/contrib/designate-dashboard/CONTRIBUTING.rst b/contrib/designate-dashboard/CONTRIBUTING.rst deleted file mode 100644 index 51e5d6329..000000000 --- a/contrib/designate-dashboard/CONTRIBUTING.rst +++ /dev/null @@ -1,17 +0,0 @@ -If you would like to contribute to the development of OpenStack, -you must follow the steps in the "If you're a developer, start here" -section of this page: - - http://wiki.openstack.org/HowToContribute - -Once those steps have been completed, changes to OpenStack -should be submitted for review via the Gerrit tool, following -the workflow documented at: - - http://wiki.openstack.org/GerritWorkflow - -Pull requests submitted through GitHub will be ignored. - -Bugs should be filed on Launchpad, not GitHub: - - https://bugs.launchpad.net/designatedashboard \ No newline at end of file diff --git a/contrib/designate-dashboard/HACKING.rst b/contrib/designate-dashboard/HACKING.rst deleted file mode 100644 index e0ddef5ac..000000000 --- a/contrib/designate-dashboard/HACKING.rst +++ /dev/null @@ -1,4 +0,0 @@ -designatedashboard Style Commandments -=============================================== - -Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/ \ No newline at end of file diff --git a/contrib/designate-dashboard/LICENSE b/contrib/designate-dashboard/LICENSE deleted file mode 100644 index 67db85882..000000000 --- a/contrib/designate-dashboard/LICENSE +++ /dev/null @@ -1,175 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. diff --git a/contrib/designate-dashboard/MANIFEST.in b/contrib/designate-dashboard/MANIFEST.in deleted file mode 100644 index 1fa7d57f2..000000000 --- a/contrib/designate-dashboard/MANIFEST.in +++ /dev/null @@ -1,8 +0,0 @@ -include AUTHORS -include ChangeLog -include README.rst -recursive-include designatedashboard *.html -exclude .gitignore -exclude .gitreview - -global-exclude *.pyc diff --git a/contrib/designate-dashboard/README.rst b/contrib/designate-dashboard/README.rst deleted file mode 100644 index 2f10899e7..000000000 --- a/contrib/designate-dashboard/README.rst +++ /dev/null @@ -1,41 +0,0 @@ -=============================== -designatedashboard -=============================== - -Designate Horizon UI bits - -* Free software: Apache license - -Features --------- - -* TODO - - -Howto ------ - -1. Package the designatedashboard by running:: - - python setup.py sdist - - This will create a python egg in the dist folder, which can be used to install - on the horizon machine or within horizon's python virtual environment. - -2. Modify horizon's settings file to enabled designatedashboard, note the two lines to add below:: - - import designatedashboard.enabled # ADD THIS LINE - - ... - - INSTALLED_APPS = list(INSTALLED_APPS) # Make sure it's mutable - settings.update_dashboards([ - openstack_dashboard.enabled, - openstack_dashboard.local.enabled, - designatedashboard.enabled, # ADD THIS LINE TOO - ], HORIZON_CONFIG, INSTALLED_APPS) - -3. (Optional) Copy the designate policy file into horizon's policy files folder, and add this config:: - - 'dns': 'designate_policy.json', - diff --git a/contrib/designate-dashboard/babel.cfg b/contrib/designate-dashboard/babel.cfg deleted file mode 100644 index efceab818..000000000 --- a/contrib/designate-dashboard/babel.cfg +++ /dev/null @@ -1 +0,0 @@ -[python: **.py] diff --git a/contrib/designate-dashboard/designatedashboard/__init__.py b/contrib/designate-dashboard/designatedashboard/__init__.py deleted file mode 100644 index 45adf783e..000000000 --- a/contrib/designate-dashboard/designatedashboard/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import pbr.version - - -__version__ = pbr.version.VersionInfo( - 'designatedashboard').version_string() diff --git a/contrib/designate-dashboard/designatedashboard/api/__init__.py b/contrib/designate-dashboard/designatedashboard/api/__init__.py deleted file mode 100644 index 97ba63851..000000000 --- a/contrib/designate-dashboard/designatedashboard/api/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from designatedashboard.api import designate # noqa diff --git a/contrib/designate-dashboard/designatedashboard/api/designate.py b/contrib/designate-dashboard/designatedashboard/api/designate.py deleted file mode 100644 index 83670ef48..000000000 --- a/contrib/designate-dashboard/designatedashboard/api/designate.py +++ /dev/null @@ -1,174 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from __future__ import absolute_import - -from designateclient.v1 import Client # noqa -from designateclient.v1.domains import Domain # noqa -from designateclient.v1.records import Record # noqa -from django.conf import settings # noqa - -from horizon import exceptions -import logging - -from openstack_dashboard.api.base import url_for # noqa - -LOG = logging.getLogger(__name__) - - -def designateclient(request): - designate_url = "" - try: - designate_url = url_for(request, 'dns') - except exceptions.ServiceCatalogException: - LOG.debug('no dns service configured.') - return None - - LOG.debug('designateclient connection created using token "%s"' - 'and url "%s"' % (request.user.token.id, designate_url)) - - insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) - cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None) - - return Client(endpoint=designate_url, - token=request.user.token.id, - username=request.user.username, - tenant_id=request.user.project_id, - insecure=insecure, - cacert=cacert) - - -def domain_get(request, domain_id): - d_client = designateclient(request) - if d_client is None: - return [] - return d_client.domains.get(domain_id) - - -def domain_list(request): - d_client = designateclient(request) - if d_client is None: - return [] - return d_client.domains.list() - - -def domain_create(request, name, email, ttl=None, description=None): - d_client = designateclient(request) - if d_client is None: - return None - - options = { - 'description': description, - } - - # TTL needs to be optionally added as argument because the client - # won't accept a None value - if ttl is not None: - options['ttl'] = ttl - - domain = Domain(name=name, email=email, **options) - - return d_client.domains.create(domain) - - -def domain_update(request, domain_id, email, ttl, description=None): - d_client = designateclient(request) - if d_client is None: - return None - - # A quirk of the designate client is that you need to start with a - # base record and then update individual fields in order to persist - # the data. The designate client will only send the 'changed' fields. - domain = Domain(id=domain_id, name='', email='') - - domain.email = email - domain.ttl = ttl - domain.description = description - - return d_client.domains.update(domain) - - -def domain_delete(request, domain_id): - d_client = designateclient(request) - if d_client is None: - return [] - return d_client.domains.delete(domain_id) - - -def server_list(request, domain_id): - d_client = designateclient(request) - if d_client is None: - return [] - return d_client.domains.list_domain_servers(domain_id) - - -def record_list(request, domain_id): - d_client = designateclient(request) - if d_client is None: - return [] - return d_client.records.list(domain_id) - - -def record_get(request, domain_id, record_id): - d_client = designateclient(request) - if d_client is None: - return [] - return d_client.records.get(domain_id, record_id) - - -def record_delete(request, domain_id, record_id): - d_client = designateclient(request) - if d_client is None: - return [] - return d_client.records.delete(domain_id, record_id) - - -def record_create(request, domain_id, **kwargs): - d_client = designateclient(request) - if d_client is None: - return [] - - record = Record(**kwargs) - return d_client.records.create(domain_id, record) - - -def record_update(request, domain_id, record_id, **kwargs): - d_client = designateclient(request) - if d_client is None: - return [] - - # A quirk of the designate client is that you need to start with a - # base record and then update individual fields in order to persist - # the data. The designate client will only send the 'changed' fields. - record = Record( - id=record_id, - type='A', - name='', - data='') - - record.type = kwargs.get('type', None) - record.name = kwargs.get('name', None) - record.data = kwargs.get('data', None) - record.priority = kwargs.get('priority', None) - record.ttl = kwargs.get('ttl', None) - record.description = kwargs.get('description', None) - - return d_client.records.update(domain_id, record) - - -def quota_get(request, project_id=None): - if not project_id: - project_id = request.user.project_id - d_client = designateclient(request) - return d_client.quotas.get(project_id) diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/__init__.py b/contrib/designate-dashboard/designatedashboard/dashboards/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/__init__.py b/contrib/designate-dashboard/designatedashboard/dashboards/project/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/__init__.py b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/forms.py b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/forms.py deleted file mode 100644 index d61ffd43d..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/forms.py +++ /dev/null @@ -1,478 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -import functools -import logging -import re - -from designateclient import exceptions as designate_exceptions -from django.core.exceptions import ValidationError # noqa -from django.core import validators -from django.utils.translation import ugettext_lazy as _ # noqa - -from horizon import forms -from horizon import messages - -from designatedashboard import api - - -LOG = logging.getLogger(__name__) - -MAX_TTL = 2147483647 -# These regexes were given to me by Kiall Mac Innes here: -# https://gerrit.hpcloud.net/#/c/25300/2/ -DOMAIN_NAME_REGEX = r'^(?!.{255,})(?:(?!\-)[A-Za-z0-9_\-]{1,63}(?= 500: - msg += " (Request ID: %(request_id)s" - data["request_id"] = ex.request_id - - form.api_error(_(msg) % data) # noqa - - return False - except Exception: - messages.error(request, form.exc_message) - return True - - return wrapped - - -class DomainForm(forms.SelfHandlingForm): - - '''Base class for DomainCreate and DomainUpdate forms. - - Sets-up all of the common form fields. - ''' - - name = forms.RegexField( - label=_("Domain Name"), - regex=DOMAIN_NAME_REGEX, - error_messages={'invalid': _('Enter a valid domain name.')}, - ) - - email = forms.EmailField( - label=_("Email"), - max_length=255, - ) - - ttl = forms.IntegerField( - label=_("TTL (seconds)"), - min_value=0, - max_value=MAX_TTL, - required=False, - ) - - description = forms.CharField( - label=_("Description"), - required=False, - max_length=160, - widget=forms.Textarea(), - ) - - -class DomainCreate(DomainForm): - - '''Form for creating new domain records. - - Name and email address are - required. - ''' - exc_message = _("Unable to create domain.") - - @handle_exc - def handle(self, request, data): - domain = api.designate.domain_create( - request, - name=data['name'], - email=data['email'], - ttl=data['ttl'], - description=data['description']) - messages.success(request, - _('Domain %(name)s created.') % - {"name": domain.name}) - return domain - - -class DomainUpdate(DomainForm): - - '''Form for displaying domain record details and updating them.''' - exc_message = _('Unable to update domain.') - - id = forms.CharField( - required=False, - widget=forms.HiddenInput() - ) - - serial = forms.CharField( - label=_("Serial"), - required=False, - widget=forms.TextInput(attrs={'readonly': 'readonly'}), - ) - - created_at = forms.CharField( - label=_("Created At"), - required=False, - widget=forms.TextInput(attrs={'readonly': 'readonly'}), - ) - - updated_at = forms.CharField( - label=_("Updated At"), - required=False, - widget=forms.TextInput(attrs={'readonly': 'readonly'}), - ) - - def __init__(self, request, *args, **kwargs): - super(DomainUpdate, self).__init__(request, *args, **kwargs) - - # Mark name as read-only - self.fields['name'].required = False - self.fields['name'].widget.attrs['readonly'] = 'readonly' - - self.fields['ttl'].required = True - - # Customize display order for fields - self.fields.keyOrder = [ - 'id', - 'name', - 'serial', - 'email', - 'ttl', - 'description', - 'created_at', - 'updated_at', - ] - - @handle_exc - def handle(self, request, data): - domain = api.designate.domain_update( - request, - domain_id=data['id'], - email=data['email'], - ttl=data['ttl'], - description=data['description']) - messages.success(request, - _('Domain %(name)s updated.') % - {"name": domain.name}) - return domain - - -class RecordForm(forms.SelfHandlingForm): - - '''Base class for RecordCreate and RecordUpdate forms. - - Sets-up all of - the form fields and implements the complex validation logic. - ''' - - domain_id = forms.CharField( - widget=forms.HiddenInput()) - - domain_name = forms.CharField( - widget=forms.HiddenInput()) - - type = forms.ChoiceField( - label=_("Record Type"), - required=False, - choices=[ - ('a', _('A - Address record')), - ('aaaa', _('AAAA - IPv6 address record')), - ('cname', _('CNAME - Canonical name record')), - ('mx', _('MX - Mail exchange record')), - ('ptr', _('PTR - Pointer record')), - ('spf', _('SPF - Sender Policy Framework')), - ('srv', _('SRV - Service locator')), - ('sshfp', _('SSHFP - SSH Public Key Fingerprint')), - ('txt', _('TXT - Text record')), - ], - widget=forms.Select(attrs={ - 'class': 'switchable', - 'data-slug': 'record_type', - }), - ) - - name = forms.CharField( - max_length=256, - required=False, - widget=forms.TextInput(attrs={ - 'class': 'switched', - 'data-switch-on': 'record_type', - 'data-record_type-a': _('Name'), - 'data-record_type-aaaa': _('Name'), - 'data-record_type-cname': _('Name'), - 'data-record_type-mx': _('Name'), - 'data-record_type-ns': _('Name'), - 'data-record_type-ptr': _('Name'), - 'data-record_type-soa': _('Name'), - 'data-record_type-spf': _('Name'), - 'data-record_type-srv': _('Name'), - 'data-record_type-sshfp': _('Name'), - 'data-record_type-txt': _('Name'), - }), - ) - - data = forms.CharField( - required=False, - widget=forms.TextInput(attrs={ - 'class': 'switched', - 'data-switch-on': 'record_type', - 'data-record_type-a': _('IP Address'), - 'data-record_type-aaaa': _('IP Address'), - 'data-record_type-cname': _('Canonical Name'), - 'data-record_type-ns': _('Name Server'), - 'data-record_type-mx': _('Mail Server'), - 'data-record_type-ptr': _('PTR Domain Name'), - 'data-record_type-soa': _('Value'), - 'data-record_type-srv': _('Value'), - }), - ) - - txt = forms.CharField( - label=_('TXT'), - required=False, - widget=forms.Textarea(attrs={ - 'class': 'switched', - 'data-switch-on': 'record_type', - 'data-record_type-txt': _('Text'), - 'data-record_type-spf': _('Text'), - 'data-record_type-sshfp': _('Text'), - }), - ) - - priority = forms.IntegerField( - min_value=0, - max_value=65535, - required=False, - widget=forms.TextInput(attrs={ - 'class': 'switched', - 'data-switch-on': 'record_type', - 'data-record_type-mx': _('Priority'), - 'data-record_type-srv': _('Priority'), - }), - ) - - ttl = forms.IntegerField( - label=_('TTL'), - min_value=0, - max_value=MAX_TTL, - required=False, - widget=forms.TextInput(attrs={ - 'class': 'switched', - 'data-switch-on': 'record_type', - 'data-record_type-a': _('TTL'), - 'data-record_type-aaaa': _('TTL'), - 'data-record_type-cname': _('TTL'), - 'data-record_type-mx': _('TTL'), - 'data-record_type-ptr': _('TTL'), - 'data-record_type-soa': _('TTL'), - 'data-record_type-spf': _('TTL'), - 'data-record_type-srv': _('TTL'), - 'data-record_type-sshfp': _('TTL'), - 'data-record_type-txt': _('TTL'), - }), - ) - - description = forms.CharField( - label=_("Description"), - required=False, - max_length=160, - widget=forms.Textarea(), - ) - - def clean_type(self): - '''Type value needs to be uppercased before it is sent to the API.''' - return self.cleaned_data['type'].upper() - - def clean(self): - '''Handles the validation logic for the domain record form. - - Validation gets pretty complicated due to the fact that the different - record types (A, AAAA, MX, etc) have different requirements for - each of the fields. - ''' - - cleaned_data = super(RecordForm, self).clean() - record_type = cleaned_data['type'] - domain_name = cleaned_data['domain_name'] - - # Name field - if self._is_field_blank(cleaned_data, 'name'): - if record_type in ['A', 'AAAA', 'CNAME', 'SRV', 'TXT', 'PTR']: - self._add_required_field_error('name') - elif record_type == 'MX': - cleaned_data['name'] = domain_name - else: - if record_type == 'SRV': - if not re.match(SRV_NAME_REGEX, cleaned_data['name']): - self._add_field_error('name', _('Enter a valid SRV name')) - else: - cleaned_data['name'] += domain_name - else: - if not re.match(WILDCARD_DOMAIN_NAME_REGEX, - cleaned_data['name']): - self._add_field_error('name', _('Enter a valid hostname.' - ' The hostname should end' - ' with a period.')) - elif not cleaned_data['name'].endswith(domain_name): - self._add_field_error( - 'name', - _('Name must be in the current domain')) - - # Data field - if self._is_field_blank(cleaned_data, 'data'): - if record_type in ['A', 'AAAA', 'CNAME', 'MX', 'SRV']: - self._add_required_field_error('data') - else: - if record_type == 'A': - try: - validators.validate_ipv4_address(cleaned_data['data']) - except ValidationError: - self._add_field_error('data', - _('Enter a valid IPv4 address')) - - elif record_type == 'AAAA': - try: - validators.validate_ipv6_address(cleaned_data['data']) - except ValidationError: - self._add_field_error('data', - _('Enter a valid IPv6 address')) - - elif record_type in ['CNAME', 'MX', 'PTR']: - if not re.match(DOMAIN_NAME_REGEX, cleaned_data['data']): - self._add_field_error('data', _('Enter a valid hostname')) - - elif record_type == 'SRV': - if not re.match(SRV_DATA_REGEX, cleaned_data['data']): - self._add_field_error('data', - _('Enter a valid SRV record')) - - # Txt field - if self._is_field_blank(cleaned_data, 'txt'): - if record_type == 'TXT': - self._add_required_field_error('txt') - else: - if record_type == 'TXT': - cleaned_data['data'] = cleaned_data['txt'] - - if record_type == 'SSHFP': - if not re.match(SSHFP_DATA_REGEX, cleaned_data['txt']): - self._add_field_error('txt', - _('Enter a valid SSHFP record')) - cleaned_data['data'] = cleaned_data['txt'] - - cleaned_data.pop('txt') - - # Priority field - if self._is_field_blank(cleaned_data, 'priority'): - if record_type in ['MX', 'SRV']: - self._add_required_field_error('priority') - - # Rename 'id' to 'record_id' - if 'id' in cleaned_data: - cleaned_data['record_id'] = cleaned_data.pop('id') - - # Remove domain_name - cleaned_data.pop('domain_name') - - return cleaned_data - - def _add_required_field_error(self, field): - '''Set a required field error on the specified field.''' - self._add_field_error(field, _('This field is required')) - - def _add_field_error(self, field, msg): - '''Set the specified msg as an error on the field.''' - self._errors[field] = self.error_class([msg]) - - def _is_field_blank(self, cleaned_data, field): - '''Returns a flag indicating whether the specified field is blank.''' - return field in cleaned_data and not cleaned_data[field] - - -class RecordCreate(RecordForm): - - '''Form for creating a new domain record.''' - exc_message = _('Unable to create record.') - - @handle_exc - def handle(self, request, data): - record = api.designate.record_create(request, **data) - messages.success(request, - _('Domain record %(name)s created.') % - {"name": record.name}) - return record - - -class RecordUpdate(RecordForm): - - '''Form for editing a domain record.''' - exc_message = _('Unable to create record.') - - id = forms.CharField(widget=forms.HiddenInput()) - - def __init__(self, request, *args, **kwargs): - super(RecordUpdate, self).__init__(request, *args, **kwargs) - - # Force the type field to be read-only - self.fields['type'].widget.attrs['readonly'] = 'readonly' - - if self['type'].value() in ('soa', 'ns'): - self.fields['type'].choices.append(('ns', _('NS'))) - self.fields['type'].choices.append(('soa', _('SOA'))) - - self.fields['name'].widget.attrs['readonly'] = 'readonly' - self.fields['data'].widget.attrs['readonly'] = 'readonly' - self.fields['description'].widget.attrs['readonly'] = 'readonly' - self.fields['ttl'].widget.attrs['readonly'] = 'readonly' - - # Filter the choice list so that it only contains the type for - # the current record. Ideally, we would just disable the select - # field, but that has the unfortunate side-effect of breaking - # the 'selectable' javascript code. - self.fields['type'].choices = ( - [choice for choice in self.fields['type'].choices - if choice[0] == self.initial['type']]) - - @handle_exc - def handle(self, request, data): - - if data['type'] in ('SOA', 'NS'): - return True - - record = api.designate.record_update(request, **data) - - messages.success(request, - _('Domain record %(name)s updated.') % - {"name": record.name}) - - return record diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/panel.py b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/panel.py deleted file mode 100644 index a7df87f0f..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/panel.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -from django.utils.translation import ugettext_lazy as _ # noqa - -import horizon -from openstack_dashboard.dashboards.project import dashboard - - -class DNSDomains(horizon.Panel): - name = _("Domains") - slug = 'dns_domains' - permissions = ('openstack.services.dns',) - - -dashboard.Project.register(DNSDomains) diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/tables.py b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/tables.py deleted file mode 100644 index 493d3e240..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/tables.py +++ /dev/null @@ -1,222 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -import logging - -from django.core import urlresolvers -from django.utils.translation import ugettext_lazy as _ # noqa - -from horizon import messages -from horizon import tables -from horizon.utils import memoized - -from designatedashboard import api - -LOG = logging.getLogger(__name__) - -EDITABLE_RECORD_TYPES = ( - "A", - "AAAA", - "CNAME", - "MX", - "PTR", - "SPF", - "SRV", - "SSHFP", - "TXT", -) - - -class CreateDomain(tables.LinkAction): - - '''Link action for navigating to the CreateDomain view.''' - name = "create_domain" - verbose_name = _("Create Domain") - url = "horizon:project:dns_domains:create_domain" - classes = ("ajax-modal", "btn-create") - policy_rules = (("dns", "create_domain"),) - - @memoized.memoized_method - def allowed(self, request, datum): - try: - if self.table: - quota = api.designate.quota_get(request) - return quota['domains'] > len(self.table.data) - except: - msg = _("The quotas could not be retrieved.") - messages.warning(request, msg) - return True - - -class EditDomain(tables.LinkAction): - - '''Link action for navigating to the UpdateDomain view.''' - name = "edit_domain" - verbose_name = _("Edit Domain") - url = "horizon:project:dns_domains:update_domain" - classes = ("ajax-modal", "btn-edit") - policy_rules = (("dns", "update_domain"),) - - -class ManageRecords(tables.LinkAction): - - '''Link action for navigating to the ManageRecords view.''' - name = "manage_records" - verbose_name = _("Manage Records") - url = "horizon:project:dns_domains:records" - classes = ("btn-edit") - policy_rules = (("dns", "get_records"),) - - -class DeleteDomain(tables.BatchAction): - - '''Batch action for deleting domains.''' - name = "delete" - action_present = _("Delete") - action_past = _("Deleted") - data_type_singular = _("Domain") - data_type_plural = _("Domains") - classes = ('btn-danger', 'btn-delete') - policy_rules = (("dns", "delete_domain"),) - - def action(self, request, domain_id): - api.designate.domain_delete(request, domain_id) - - -class CreateRecord(tables.LinkAction): - - '''Link action for navigating to the CreateRecord view.''' - name = "create_record" - verbose_name = _("Create Record") - classes = ("ajax-modal", "btn-create") - policy_rules = (("dns", "create_record"),) - - def get_link_url(self, datum=None): - url = "horizon:project:dns_domains:create_record" - return urlresolvers.reverse(url, kwargs=self.table.kwargs) - - -class EditRecord(tables.LinkAction): - - '''Link action for navigating to the UpdateRecord view.''' - name = "edit_record" - verbose_name = _("Edit Record") - classes = ("ajax-modal", "btn-edit") - policy_rules = (("dns", "update_record"),) - - def get_link_url(self, datum=None): - url = "horizon:project:dns_domains:update_record" - kwargs = { - 'domain_id': datum.domain_id, - 'record_id': datum.id, - } - - return urlresolvers.reverse(url, kwargs=kwargs) - - def allowed(self, request, record=None): - return record.type in EDITABLE_RECORD_TYPES - - -class DeleteRecord(tables.DeleteAction): - - '''Link action for navigating to the UpdateRecord view.''' - data_type_singular = _("Record") - policy_rules = (("dns", "delete_record"),) - - def delete(self, request, record_id): - domain_id = self.table.kwargs['domain_id'] - return api.designate.record_delete(request, domain_id, record_id) - - def allowed(self, request, record=None): - return record.type in EDITABLE_RECORD_TYPES - - -class BatchDeleteRecord(tables.BatchAction): - - '''Batch action for deleting domain records.''' - - name = "delete" - action_present = _("Delete") - action_past = _("Deleted") - data_type_singular = _("Record") - classes = ('btn-danger', 'btn-delete') - policy_rules = (("dns", "delete_record"),) - - def action(self, request, record_id): - domain_id = self.table.kwargs['domain_id'] - api.designate.record_delete(request, domain_id, record_id) - - -class DomainsTable(tables.DataTable): - - '''Data table for displaying domain summary information.''' - - name = tables.Column("name", - verbose_name=_("Name"), - link=("horizon:project:dns_domains:domain_detail")) - - email = tables.Column("email", - verbose_name=_("Email")) - - ttl = tables.Column("ttl", - verbose_name=_("TTL")) - - serial = tables.Column("serial", - verbose_name=_("Serial")) - - class Meta: - name = "domains" - verbose_name = _("Domains") - table_actions = (CreateDomain, DeleteDomain,) - row_actions = (ManageRecords, EditDomain, DeleteDomain,) - - -def record__details_link(record): - '''Returns a link to the view for updating DNS records.''' - - return urlresolvers.reverse( - "horizon:project:dns_domains:view_record", - args=(record.domain_id, record.id)) - - -class RecordsTable(tables.DataTable): - - '''Data table for displaying summary information for a domains records.''' - - name = tables.Column("name", - verbose_name=_("Name"), - link=record__details_link, - ) - - type = tables.Column("type", - verbose_name=_("Type") - ) - - data = tables.Column("data", - verbose_name=_("Data") - ) - - priority = tables.Column("priority", - verbose_name=_("Priority"), - ) - - ttl = tables.Column("ttl", - verbose_name=_("TTL") - ) - - class Meta: - name = "records" - verbose_name = _("Records") - table_actions = (CreateRecord,) - row_actions = (EditRecord, DeleteRecord,) - multi_select = False diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_create_domain.html b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_create_domain.html deleted file mode 100644 index 420574127..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_create_domain.html +++ /dev/null @@ -1,38 +0,0 @@ -{% extends "horizon/common/_modal_form.html" %} -{% load i18n horizon humanize %} - -{% block form_id %}{% endblock %} -{% block form_action %}{% url 'horizon:project:dns_domains:create_domain' %}{% endblock %} - -{% block modal_id %}create_domain_modal{% endblock %} -{% block modal-header %}{% trans "Create Domain" %}{% endblock %} - -{% block modal-body %} -
-
- {% include "horizon/common/_form_fields.html" %} -
-
- -
-

{% trans "Description" %}:

-

{% blocktrans %} - The Name field should contain a full-qualified domain name (with - trailing period). - {% endblocktrans %}

-

{% blocktrans %} - The Email field should contain a valid email address to be associated - with the domain. - {% endblocktrans %}

-

{% blocktrans %} - The optional TTL field can be any value between 0 and 2147483647 - seconds. - {% endblocktrans %}

-
- -{% endblock %} - -{% block modal-footer %} - - {% trans "Cancel" %} -{% endblock %} diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_create_record.html b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_create_record.html deleted file mode 100644 index 605222e55..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_create_record.html +++ /dev/null @@ -1,25 +0,0 @@ -{% extends "horizon/common/_modal_form.html" %} -{% load i18n horizon humanize %} - -{% block form_id %}{% endblock %} -{% block form_action %}{% url 'horizon:project:dns_domains:create_record' domain.id %}{% endblock %} - -{% block modal_id %}create_record_modal{% endblock %} -{% block modal-header %}{% trans "Create Record for" %} {{ domain.name }}{% endblock %} - -{% block modal-body-right %} -

{% trans "Description:" %}

- {% blocktrans %} -

- Please note: - For record types, the name must end with a period. -

-

- TTL - The TTL is the time-to-live for the record, in seconds. -

-

- See more info on record types. -

- {% endblocktrans %} -{% endblock %} diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_domain_detail.html b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_domain_detail.html deleted file mode 100644 index 2643938cb..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_domain_detail.html +++ /dev/null @@ -1,32 +0,0 @@ -{% load i18n sizeformat %} - -

{% trans "Domain Overview" %}

- -
-
-
{% trans "ID" %}
-
{{ domain.id|default:_("None") }}
-
{% trans "Name" %}
-
{{ domain.name|default:_("None") }}
-
{% trans "Description" %}
-
{{ domain.description|default:_("None") }}
-
{% trans "Serial" %}
-
{{ domain.serial|yesno|capfirst }}
-
{% trans "Email" %}
-
{{ domain.email|default:_("Unknown") }}
-
{% trans "TTL" %}
-
{{ domain.ttl|default:_("Unknown") }}
-
{% trans "Created" %}
- {% if domain.created_at %} -
{{ domain.created_at|parse_isotime }}
- {% else %} -
{% trans "Unknown" %}
- {% endif %} -
{% trans "Updated" %}
- {% if domain.updated_at %} -
{{ domain.updated_at|parse_isotime }}
- {% else %} -
{% trans "Unknown" %}
- {% endif %} -
-
diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_record_detail.html b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_record_detail.html deleted file mode 100644 index eb86adc3f..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_record_detail.html +++ /dev/null @@ -1,36 +0,0 @@ -{% load i18n sizeformat %} - -

{% trans "All Records" %}

- -

{{ record.name|default:_("None") }}

- -
-
-
{% trans "Name" %}
-
{{ record.name|default:_("None") }}
-
{% trans "ID" %}
-
{{ record.id|default:_("None") }}
-
{% trans "Type" %}
-
{{ record.type|default:_("Unknown") }}
-
{% trans "Description" %}
-
{{ record.description|default:_("None") }}
-
{% trans "Record Data" %}
-
{{ record.data|default:_("None") }}
-
{% trans "Priority" %}
-
{{ record.priority|yesno|capfirst }}
-
{% trans "TTL" %}
-
{{ record.ttl|default:_("None") }}
-
{% trans "Created" %}
- {% if record.created_at %} -
{{ record.created_at|parse_isotime }}
- {% else %} -
{% trans "Unknown" %}
- {% endif %} -
{% trans "Updated" %}
- {% if record.updated_at %} -
{{ record.updated_at|parse_isotime }}
- {% else %} -
{% trans "Unknown" %}
- {% endif %} -
-
diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_update_domain.html b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_update_domain.html deleted file mode 100644 index b6b4e1fb2..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_update_domain.html +++ /dev/null @@ -1,36 +0,0 @@ -{% extends "horizon/common/_modal_form.html" %} -{% load i18n %} -{% load url from future %} - -{% block form_id %}update_domain_form{% endblock %} -{% block form_action %}{% url 'horizon:project:dns_domains:update_domain' domain.id %}{% endblock %} - -{% block modal-header %}{% trans "Update Domain" %}{% endblock %} - -{% block modal-body %} -
-
- {% include "horizon/common/_form_fields.html" %} -
-
- -
-

{% trans "Description" %}:

-

{% blocktrans %} - From here you can edit the email address and TTL associated with a domain. - {% endblocktrans %}

-

{% blocktrans %} - The Email field should contain a valid email address to be associated - with the domain. - {% endblocktrans %}

-

{% blocktrans %} - The optional TTL field can be any value between 0 and 2147483647 - seconds. - {% endblocktrans %}

-
-{% endblock %} - -{% block modal-footer %} - - {% trans "Cancel" %} -{% endblock %} diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_update_record.html b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_update_record.html deleted file mode 100644 index 4344f36c3..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/_update_record.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "project/dns_domains/_create_record.html" %} -{% load i18n %} -{% load url from future %} - -{% block form_id %}update_record_form{% endblock %} -{% block form_action %}{% url 'horizon:project:dns_domains:update_record' record.domain_id record.id %}{% endblock %} - -{% block modal-header %}{% trans "Update Domain Record" %}{% endblock %} - diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/create_domain.html b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/create_domain.html deleted file mode 100644 index fe6380c5f..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/create_domain.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends 'base.html' %} -{% load i18n %} -{% block title %}{% trans "Create Domain" %}{% endblock %} - -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Create Domain") %} -{% endblock page_header %} - -{% block main %} - {% include 'project/dns_domains/_create_domain.html' %} -{% endblock %} diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/create_record.html b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/create_record.html deleted file mode 100644 index 4414f32eb..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/create_record.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends 'base.html' %} -{% load i18n %} -{% block title %}{% trans "Create Domain Record" %}{% endblock %} - -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Create Domain Record") %} -{% endblock page_header %} - -{% block main %} - {% include 'project/dns_domains/_create_record.html' %} -{% endblock %} diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/domain_detail.html b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/domain_detail.html deleted file mode 100644 index 4b0380f7e..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/domain_detail.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends 'base.html' %} -{% load i18n %} -{% block title %}{% trans 'Domain Detail' %}{% endblock %} - -{% block page_header %} - {% include "horizon/common/_page_header.html" with title="Domain" %} -{% endblock page_header %} - -{% block main %} - {% include 'project/dns_domains/_domain_detail.html' %} -{% endblock %} diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/index.html b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/index.html deleted file mode 100644 index a7d629b71..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/index.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends 'base.html' %} -{% load i18n %} -{% block title %}{% trans "Domains" %}{% endblock %} - -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Domains") %} -{% endblock page_header %} - -{% block main %} - {{ table.render }} -{% endblock %} diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/record_detail.html b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/record_detail.html deleted file mode 100644 index bb94f9f11..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/record_detail.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends 'base.html' %} -{% load i18n %} -{% block title %}{% trans 'Record Detail' %}{% endblock %} - -{% block page_header %} - {% include "horizon/common/_page_header.html" with title="Record Detail" %} -{% endblock page_header %} - -{% block main %} - {% include 'project/dns_domains/_record_detail.html' %} -{% endblock %} diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/records.html b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/records.html deleted file mode 100644 index b478180f6..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/records.html +++ /dev/null @@ -1,32 +0,0 @@ -{% extends 'base.html' %} -{% load i18n %} -{% block title %}{% trans 'Domain Records' %}{% endblock %} - -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Domain Records") %} -{% endblock page_header %} - -{% block main %} -
-
-
-

- {% trans "Domains" %} : {{ domain.name }} → - {% trans "Records" %} -

-
-
- × -
-
-
-

Nameservers

-
    - {% for server in servers %} -
  • {{ server.name }}
  • - {% endfor %} -
-
- - {{ table.render }} -{% endblock %} diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/update_domain.html b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/update_domain.html deleted file mode 100644 index fee32f2ad..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/update_domain.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends 'adminui/base.html' %} -{% load i18n %} -{% block title %}{% trans 'Update Domain' %}{% endblock %} - -{% block page_header %} - {% include "horizon/common/_page_header.html" with title="Domain" %} -{% endblock page_header %} - -{% block main %} - {% include 'project/dns_domains/_update_domain.html' %} -{% endblock %} diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/update_record.html b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/update_record.html deleted file mode 100644 index ca2b7a747..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/templates/dns_domains/update_record.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends 'base.html' %} -{% load i18n %} -{% block title %}{% trans 'Update Domain Record' %}{% endblock %} - -{% block page_header %} - {% include "horizon/common/_page_header.html" with title="Domain Record" %} -{% endblock page_header %} - -{% block main %} - {% include 'project/dns_domains/_update_record.html' %} -{% endblock %} diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/tests.py b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/tests.py deleted file mode 100644 index 9466c52ab..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/tests.py +++ /dev/null @@ -1,447 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2012 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. -# All Rights Reserved. -# -# Copyright 2012 Nebula, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -from __future__ import unicode_literals - -from django.core.urlresolvers import reverse # noqa -from django import http - -from mox import IsA # noqa - -from openstack_dashboard import api -from openstack_dashboard.test import helpers as test - -from designatedashboard.dashboards.project.dns_domains import forms - - -DOMAIN_ID = '123' -INDEX_URL = reverse('horizon:project:dns_domains:index') -RECORDS_URL = reverse('horizon:project:dns_domains:records', args=[DOMAIN_ID]) - - -class DNSDomainsTests(test.TestCase): - - def setUp(self): - super(DNSDomainsTests, self).setUp() - - @test.create_stubs( - {api.designate: ('domain_list',)}) - def test_index(self): - domains = self.dns_domains.list() - api.designate.domain_list( - IsA(http.HttpRequest)).AndReturn(domains) - self.mox.ReplayAll() - - res = self.client.get(INDEX_URL) - - self.assertTemplateUsed(res, 'project/dns_domains/index.html') - self.assertEqual(len(res.context['table'].data), len(domains)) - - @test.create_stubs( - {api.designate: ('domain_get', 'server_list', 'record_list')}) - def test_records(self): - domain_id = '123' - domain = self.dns_domains.first() - servers = self.dns_servers.list() - records = self.dns_records.list() - - api.designate.domain_get( - IsA(http.HttpRequest), - domain_id).AndReturn(domain) - - api.designate.server_list( - IsA(http.HttpRequest), - domain_id).AndReturn(servers) - - api.designate.record_list( - IsA(http.HttpRequest), - domain_id).AndReturn(records) - - self.mox.ReplayAll() - - res = self.client.get(RECORDS_URL) - - self.assertTemplateUsed(res, 'project/dns_domains/records.html') - self.assertEqual(len(res.context['table'].data), len(records)) - - -class BaseRecordFormCleanTests(test.TestCase): - - DOMAIN_NAME = 'foo.com.' - HOSTNAME = 'www.foo.com.' - - MSG_FIELD_REQUIRED = 'This field is required' - MSG_INVALID_HOSTNAME = 'Enter a valid hostname' - MSG_OUTSIDE_DOMAIN = 'Name must be in the current domain' - - def setUp(self): - super(BaseRecordFormCleanTests, self).setUp() - - # Request object with messages support - self.request = self.factory.get('', {}) - - # Set-up form instance - self.form = forms.RecordCreate(self.request) - self.form._errors = {} - self.form.cleaned_data = { - 'domain_name': self.DOMAIN_NAME, - 'name': '', - 'data': '', - 'txt': '', - 'priority': None, - 'ttl': None, - } - - def assert_no_errors(self): - self.assertEqual(self.form._errors, {}) - - def assert_error(self, field, msg): - self.assertIn(msg, self.form._errors[field]) - - def assert_required_error(self, field): - self.assert_error(field, self.MSG_FIELD_REQUIRED) - - -class ARecordFormTests(BaseRecordFormCleanTests): - - IPV4 = '1.1.1.1' - - MSG_INVALID_IPV4 = 'Enter a valid IPv4 address' - - def setUp(self): - super(ARecordFormTests, self).setUp() - self.form.cleaned_data['type'] = 'A' - self.form.cleaned_data['name'] = self.HOSTNAME - self.form.cleaned_data['data'] = self.IPV4 - - def test_valid_field_values(self): - self.form.clean() - self.assert_no_errors() - - def test_valid_name_field_wild_card(self): - self.form.cleaned_data['name'] = '*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_no_errors() - - def test_missing_name_field(self): - self.form.cleaned_data['name'] = '' - self.form.clean() - self.assert_required_error('name') - - def test_missing_data_field(self): - self.form.cleaned_data['data'] = '' - self.form.clean() - self.assert_required_error('data') - - def test_invalid_name_field(self): - self.form.cleaned_data['name'] = 'foo' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_starting_dash(self): - self.form.cleaned_data['name'] = '-ww.foo.com' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_trailing_dash(self): - self.form.cleaned_data['name'] = 'www.foo.co-' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_bad_wild_card(self): - self.form.cleaned_data['name'] = 'derp.*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_outside_of_domain_name_field(self): - self.form.cleaned_data['name'] = 'www.bar.com.' - self.form.clean() - self.assert_error('name', self.MSG_OUTSIDE_DOMAIN) - - def test_invalid_data_field(self): - self.form.cleaned_data['data'] = 'foo' - self.form.clean() - self.assert_error('data', self.MSG_INVALID_IPV4) - - -class AAAARecordFormTests(BaseRecordFormCleanTests): - - IPV6 = '1111:1111:1111:11::1' - - MSG_INVALID_IPV6 = 'Enter a valid IPv6 address' - - def setUp(self): - super(AAAARecordFormTests, self).setUp() - self.form.cleaned_data['type'] = 'AAAA' - self.form.cleaned_data['name'] = self.HOSTNAME - self.form.cleaned_data['data'] = self.IPV6 - - def test_valid_field_values(self): - self.form.clean() - self.assert_no_errors() - - def test_valid_name_field_wild_card(self): - self.form.cleaned_data['name'] = '*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_no_errors() - - def test_missing_name_field(self): - self.form.cleaned_data['name'] = '' - self.form.clean() - self.assert_required_error('name') - - def test_missing_data_field(self): - self.form.cleaned_data['data'] = '' - self.form.clean() - self.assert_required_error('data') - - def test_invalid_name_field(self): - self.form.cleaned_data['name'] = 'foo' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_starting_dash(self): - self.form.cleaned_data['name'] = '-ww.foo.com' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_trailing_dash(self): - self.form.cleaned_data['name'] = 'www.foo.co-' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_bad_wild_card(self): - self.form.cleaned_data['name'] = 'derp.*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_outside_of_domain_name_field(self): - self.form.cleaned_data['name'] = 'www.bar.com.' - self.form.clean() - self.assert_error('name', self.MSG_OUTSIDE_DOMAIN) - - def test_invalid_data_field(self): - self.form.cleaned_data['data'] = 'foo' - self.form.clean() - self.assert_error('data', self.MSG_INVALID_IPV6) - - -class CNAMERecordFormTests(BaseRecordFormCleanTests): - - CNAME = 'bar.foo.com.' - - def setUp(self): - super(CNAMERecordFormTests, self).setUp() - self.form.cleaned_data['type'] = 'CNAME' - self.form.cleaned_data['name'] = self.HOSTNAME - self.form.cleaned_data['data'] = self.CNAME - - def test_valid_field_values(self): - self.form.clean() - self.assert_no_errors() - - def test_valid_name_field_wild_card(self): - self.form.cleaned_data['name'] = '*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_no_errors() - - def test_missing_name_field(self): - self.form.cleaned_data['name'] = '' - self.form.clean() - self.assert_required_error('name') - - def test_missing_data_field(self): - self.form.cleaned_data['data'] = '' - self.form.clean() - self.assert_required_error('data') - - def test_invalid_name_field(self): - self.form.cleaned_data['name'] = 'foo' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_starting_dash(self): - self.form.cleaned_data['name'] = '-ww.foo.com' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_trailing_dash(self): - self.form.cleaned_data['name'] = 'www.foo.co-' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_bad_wild_card(self): - self.form.cleaned_data['name'] = 'derp.*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_outside_of_domain_name_field(self): - self.form.cleaned_data['name'] = 'www.bar.com.' - self.form.clean() - self.assert_error('name', self.MSG_OUTSIDE_DOMAIN) - - def test_invalid_data_field(self): - self.form.cleaned_data['data'] = 'foo' - self.form.clean() - self.assert_error('data', self.MSG_INVALID_HOSTNAME) - - -class MXRecordFormTests(BaseRecordFormCleanTests): - - MAIL_SERVER = 'mail.foo.com.' - PRIORITY = 10 - - def setUp(self): - super(MXRecordFormTests, self).setUp() - self.form.cleaned_data['type'] = 'MX' - self.form.cleaned_data['data'] = self.MAIL_SERVER - self.form.cleaned_data['priority'] = self.PRIORITY - - def test_valid_field_values(self): - self.form.clean() - self.assert_no_errors() - - def test_missing_data_field(self): - self.form.cleaned_data['data'] = '' - self.form.clean() - self.assert_required_error('data') - - def test_missing_priority_field(self): - self.form.cleaned_data['priority'] = None - self.form.clean() - self.assert_required_error('priority') - - def test_invalid_data_field(self): - self.form.cleaned_data['data'] = 'foo' - self.form.clean() - self.assert_error('data', self.MSG_INVALID_HOSTNAME) - - def test_default_assignment_name_field(self): - self.form.clean() - self.assertEqual(self.DOMAIN_NAME, self.form.cleaned_data['name']) - - -class TXTRecordFormTests(BaseRecordFormCleanTests): - - TEXT = 'Lorem ipsum' - - def setUp(self): - super(TXTRecordFormTests, self).setUp() - self.form.cleaned_data['type'] = 'TXT' - self.form.cleaned_data['name'] = self.HOSTNAME - self.form.cleaned_data['txt'] = self.TEXT - - def test_valid_field_values(self): - self.form.clean() - self.assert_no_errors() - - def test_valid_name_field_wild_card(self): - self.form.cleaned_data['name'] = '*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_no_errors() - - def test_missing_name_field(self): - self.form.cleaned_data['name'] = '' - self.form.clean() - self.assert_required_error('name') - - def test_missing_txt_field(self): - self.form.cleaned_data['txt'] = '' - self.form.clean() - self.assert_required_error('txt') - - def test_invalid_name_field(self): - self.form.cleaned_data['name'] = 'foo' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_starting_dash(self): - self.form.cleaned_data['name'] = '-ww.foo.com' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_trailing_dash(self): - self.form.cleaned_data['name'] = 'www.foo.co-' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_bad_wild_card(self): - self.form.cleaned_data['name'] = 'derp.*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_outside_of_domain_name_field(self): - self.form.cleaned_data['name'] = 'www.bar.com.' - self.form.clean() - self.assert_error('name', self.MSG_OUTSIDE_DOMAIN) - - def test_default_assignment_data_field(self): - self.form.clean() - self.assertEqual(self.TEXT, self.form.cleaned_data['data']) - - -class SRVRecordFormTests(BaseRecordFormCleanTests): - - SRV_NAME = '_foo._tcp.' - SRV_DATA = '1 1 srv.foo.com.' - PRIORITY = 10 - - MSG_INVALID_SRV_NAME = 'Enter a valid SRV name' - MSG_INVALID_SRV_DATA = 'Enter a valid SRV record' - - def setUp(self): - super(SRVRecordFormTests, self).setUp() - self.form.cleaned_data['type'] = 'SRV' - self.form.cleaned_data['name'] = self.SRV_NAME - self.form.cleaned_data['data'] = self.SRV_DATA - self.form.cleaned_data['priority'] = self.PRIORITY - - def test_valid_field_values(self): - self.form.clean() - self.assert_no_errors() - - def test_missing_name_field(self): - self.form.cleaned_data['name'] = '' - self.form.clean() - self.assert_required_error('name') - - def test_missing_data_field(self): - self.form.cleaned_data['data'] = '' - self.form.clean() - self.assert_required_error('data') - - def test_missing_priority_field(self): - self.form.cleaned_data['priority'] = None - self.form.clean() - self.assert_required_error('priority') - - def test_invalid_name_field(self): - self.form.cleaned_data['name'] = 'foo' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_SRV_NAME) - - def test_invalid_data_field(self): - self.form.cleaned_data['data'] = 'foo' - self.form.clean() - self.assert_error('data', self.MSG_INVALID_SRV_DATA) - - def test_default_assignment_name_field(self): - self.form.clean() - self.assertEqual(self.SRV_NAME + self.DOMAIN_NAME, - self.form.cleaned_data['name']) diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/urls.py b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/urls.py deleted file mode 100644 index 1a2231bc2..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/urls.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -from django.conf.urls import url, patterns # noqa - -from .views import CreateDomainView # noqa -from .views import CreateRecordView # noqa -from .views import DomainDetailView # noqa -from .views import IndexView # noqa -from .views import RecordsView # noqa -from .views import UpdateDomainView # noqa -from .views import UpdateRecordView # noqa -from .views import ViewRecordDetailsView # noqa - - -urlpatterns = patterns( - '', - url(r'^$', - IndexView.as_view(), - name='index'), - url(r'^create/$', - CreateDomainView.as_view(), - name='create_domain'), - url(r'^(?P[^/]+)/update$', - UpdateDomainView.as_view(), - name='update_domain'), - url(r'^(?P[^/]+)$', - DomainDetailView.as_view(), - name='domain_detail'), - url(r'^(?P[^/]+)/records$', - RecordsView.as_view(), - name='records'), - url(r'^(?P[^/]+)/records/create$', - CreateRecordView.as_view(), - name='create_record'), - url(r'^(?P[^/]+)/records/(?P[^/]+)/update$', - UpdateRecordView.as_view(), - name='update_record'), - url(r'^(?P[^/]+)/records/(?P[^/]+)/$', - ViewRecordDetailsView.as_view(), - name='view_record'), -) diff --git a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/views.py b/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/views.py deleted file mode 100644 index 099bce15a..000000000 --- a/contrib/designate-dashboard/designatedashboard/dashboards/project/dns_domains/views.py +++ /dev/null @@ -1,224 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -from django.core.urlresolvers import reverse, reverse_lazy # noqa -from django.utils.translation import ugettext_lazy as _ # noqa - -from horizon import exceptions -from horizon import forms -from horizon import tables -from horizon.views import HorizonTemplateView # noqa - -from designatedashboard import api - -from .forms import DomainCreate # noqa -from .forms import DomainUpdate # noqa -from .forms import RecordCreate # noqa -from .forms import RecordUpdate # noqa -from .tables import DomainsTable # noqa -from .tables import RecordsTable # noqa - - -class IndexView(tables.DataTableView): - table_class = DomainsTable - template_name = 'project/dns_domains/index.html' - - def get_data(self): - try: - return api.designate.domain_list(self.request) - except Exception: - exceptions.handle(self.request, - _('Unable to retrieve domain list.')) - return [] - - -class CreateDomainView(forms.ModalFormView): - form_class = DomainCreate - template_name = 'project/dns_domains/create_domain.html' - success_url = reverse_lazy('horizon:project:dns_domains:index') - - def get_object_display(self, obj): - return obj.ip - - -class DomainDetailView(HorizonTemplateView): - template_name = 'project/dns_domains/domain_detail.html' - - def get_context_data(self, **kwargs): - context = super(DomainDetailView, self).get_context_data(**kwargs) - domain_id = self.kwargs['domain_id'] - try: - context["domain"] = api.designate.domain_get(self.request, - domain_id) - table = DomainsTable(self.request) - context["actions"] = table.render_row_actions(context["domain"]) - except Exception: - redirect = reverse('horizon:project:dns_domains:index') - exceptions.handle(self.request, - _('Unable to retrieve domain record.'), - redirect=redirect) - return context - - -class UpdateDomainView(forms.ModalFormView): - form_class = DomainUpdate - template_name = 'project/dns_domains/update_domain.html' - success_url = reverse_lazy('horizon:project:dns_domains:index') - - def get_object(self): - domain_id = self.kwargs['domain_id'] - try: - return api.designate.domain_get(self.request, domain_id) - except Exception: - redirect = reverse('horizon:project:dns_domains:index') - exceptions.handle(self.request, - _('Unable to retrieve domain record.'), - redirect=redirect) - - def get_initial(self): - self.domain = self.get_object() - return self.domain - - def get_context_data(self, **kwargs): - context = super(UpdateDomainView, self).get_context_data(**kwargs) - context["domain"] = self.domain - return context - - -class RecordsView(tables.DataTableView): - table_class = RecordsTable - template_name = 'project/dns_domains/records.html' - - def get_data(self): - domain_id = self.kwargs['domain_id'] - try: - self.domain = api.designate.domain_get(self.request, domain_id) - self.servers = api.designate.server_list(self.request, domain_id) - records = api.designate.record_list(self.request, domain_id) - except Exception: - redirect = reverse('horizon:project:dns_domains:index') - exceptions.handle(self.request, - _('Unable to retrieve record list.'), - redirect=redirect) - - # TODO(Matt): This may not be defined here. - return records - - def get_context_data(self, **kwargs): - context = super(RecordsView, self).get_context_data(**kwargs) - context['domain'] = self.domain - context['servers'] = self.servers - - return context - - -class BaseRecordFormView(forms.ModalFormView): - - def get_success_url(self): - return reverse('horizon:project:dns_domains:records', - args=(self.kwargs['domain_id'],)) - - def get_domain(self): - domain_id = self.kwargs['domain_id'] - try: - return api.designate.domain_get(self.request, domain_id) - except Exception: - redirect = reverse('horizon:project:dns_domains:records', - args=(self.kwargs['domain_id'],)) - exceptions.handle(self.request, - ('Unable to retrieve domain record.'), - redirect=redirect) - # NotAuthorized errors won't be redirected automatically. Need - # to force the issue - raise exceptions.Http302(redirect) - - def get_initial(self): - self.domain = self.get_domain() - - return { - 'domain_id': self.domain.id, - 'domain_name': self.domain.name, - } - - def get_context_data(self, **kwargs): - context = super(BaseRecordFormView, self).get_context_data(**kwargs) - context['domain'] = self.domain - return context - - -class CreateRecordView(BaseRecordFormView): - form_class = RecordCreate - template_name = 'project/dns_domains/create_record.html' - - -class ViewRecordDetailsView(HorizonTemplateView): - template_name = 'project/dns_domains/record_detail.html' - - def get_record(self): - domain_id = self.kwargs['domain_id'] - record_id = self.kwargs['record_id'] - try: - return api.designate.record_get(self.request, domain_id, record_id) - except Exception: - redirect = reverse('horizon:project:dns_domains:records', - args=(self.kwargs['domain_id'],)) - exceptions.handle(self.request, - _('Unable to retrieve domain record.'), - redirect=redirect) - - def get_context_data(self, **kwargs): - context = super(ViewRecordDetailsView, self).get_context_data(**kwargs) - self.record = self.get_record() - context["record"] = self.record - context["domain_id"] = self.kwargs['domain_id'] - return context - - -class UpdateRecordView(BaseRecordFormView): - form_class = RecordUpdate - template_name = 'project/dns_domains/update_record.html' - - def get_record(self): - domain_id = self.kwargs['domain_id'] - record_id = self.kwargs['record_id'] - - try: - return api.designate.record_get(self.request, domain_id, record_id) - except Exception: - redirect = reverse('horizon:project:dns_domains:records', - args=(self.kwargs['domain_id'],)) - exceptions.handle(self.request, - _('Unable to retrieve domain record.'), - redirect=redirect) - - def get_initial(self): - initial = super(UpdateRecordView, self).get_initial() - self.record = self.get_record() - - initial.update({ - 'id': self.record.id, - 'name': self.record.name, - 'data': self.record.data, - 'txt': self.record.data, - 'priority': self.record.priority, - 'ttl': self.record.ttl, - 'type': self.record.type.lower(), - 'description': self.record.description, - }) - - return initial - - def get_context_data(self, **kwargs): - context = super(UpdateRecordView, self).get_context_data(**kwargs) - context["record"] = self.record - return context diff --git a/contrib/designate-dashboard/designatedashboard/enabled/_70_dns_add_group.py b/contrib/designate-dashboard/designatedashboard/enabled/_70_dns_add_group.py deleted file mode 100644 index 4473e4049..000000000 --- a/contrib/designate-dashboard/designatedashboard/enabled/_70_dns_add_group.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# The name of the panel group to be added to HORIZON_CONFIG. Required. -PANEL_GROUP = 'dns' -# The display name of the PANEL_GROUP. Required. -PANEL_GROUP_NAME = 'DNS' -# The name of the dashboard the PANEL_GROUP associated with. Required. -PANEL_GROUP_DASHBOARD = 'project' diff --git a/contrib/designate-dashboard/designatedashboard/enabled/_71_dns_project.py b/contrib/designate-dashboard/designatedashboard/enabled/_71_dns_project.py deleted file mode 100644 index 307587de2..000000000 --- a/contrib/designate-dashboard/designatedashboard/enabled/_71_dns_project.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from designatedashboard import exceptions - -# The name of the panel to be added to HORIZON_CONFIG. Required. -PANEL = 'domains' -# The name of the dashboard the PANEL associated with. Required. -PANEL_DASHBOARD = 'project' -# The name of the panel group the PANEL is associated with. -PANEL_GROUP = 'dns' - -ADD_EXCEPTIONS = { - 'recoverable': exceptions.RECOVERABLE, - 'not_found': exceptions.NOT_FOUND, - 'unauthorized': exceptions.UNAUTHORIZED, -} - -# Python panel class of the PANEL to be added. -ADD_PANEL = ( - 'designatedashboard.dashboards.project.dns_domains.panel.DNSDomains') diff --git a/contrib/designate-dashboard/designatedashboard/enabled/__init__.py b/contrib/designate-dashboard/designatedashboard/enabled/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/contrib/designate-dashboard/designatedashboard/exceptions.py b/contrib/designate-dashboard/designatedashboard/exceptions.py deleted file mode 100644 index 677fba61d..000000000 --- a/contrib/designate-dashboard/designatedashboard/exceptions.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2014 Rackspace Hosting. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. -from designateclient import exceptions as designateclient - -from openstack_dashboard import exceptions - -NOT_FOUND = exceptions.NOT_FOUND + ( - designateclient.ResourceNotFound, - designateclient.NotFound, - ) -RECOVERABLE = exceptions.RECOVERABLE + ( - designateclient.BadRequest, - designateclient.Conflict, - ) -UNAUTHORIZED = exceptions.UNAUTHORIZED + ( - designateclient.Forbidden, - ) diff --git a/contrib/designate-dashboard/designatedashboard/tests/.secret_key_store b/contrib/designate-dashboard/designatedashboard/tests/.secret_key_store deleted file mode 100644 index 6e8db9bf0..000000000 --- a/contrib/designate-dashboard/designatedashboard/tests/.secret_key_store +++ /dev/null @@ -1 +0,0 @@ -5NMb6ZfXYBLClFGFYf6VkbiJ9TRNyU3w8NQHPG8LXJltU8EZFeB7I632vQ8MF5m6 \ No newline at end of file diff --git a/contrib/designate-dashboard/designatedashboard/tests/__init__.py b/contrib/designate-dashboard/designatedashboard/tests/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/contrib/designate-dashboard/designatedashboard/tests/base.py b/contrib/designate-dashboard/designatedashboard/tests/base.py deleted file mode 100644 index 3bf12a835..000000000 --- a/contrib/designate-dashboard/designatedashboard/tests/base.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright 2010-2011 OpenStack Foundation -# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import os - -import fixtures -import testtools - -_TRUE_VALUES = ('True', 'true', '1', 'yes') - - -class TestCase(testtools.TestCase): - - """Test case base class for all unit tests.""" - - def setUp(self): - """Run before each test method to initialize test environment.""" - - super(TestCase, self).setUp() - test_timeout = os.environ.get('OS_TEST_TIMEOUT', 0) - try: - test_timeout = int(test_timeout) - except ValueError: - # If timeout value is invalid do not set a timeout. - test_timeout = 0 - if test_timeout > 0: - self.useFixture(fixtures.Timeout(test_timeout, gentle=True)) - - self.useFixture(fixtures.NestedTempfile()) - self.useFixture(fixtures.TempHomeDir()) - - if os.environ.get('OS_STDOUT_CAPTURE') in _TRUE_VALUES: - stdout = self.useFixture(fixtures.StringStream('stdout')).stream - self.useFixture(fixtures.MonkeyPatch('sys.stdout', stdout)) - if os.environ.get('OS_STDERR_CAPTURE') in _TRUE_VALUES: - stderr = self.useFixture(fixtures.StringStream('stderr')).stream - self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr)) - - self.log_fixture = self.useFixture(fixtures.FakeLogger()) \ No newline at end of file diff --git a/contrib/designate-dashboard/designatedashboard/tests/settings.py b/contrib/designate-dashboard/designatedashboard/tests/settings.py deleted file mode 100644 index 971613305..000000000 --- a/contrib/designate-dashboard/designatedashboard/tests/settings.py +++ /dev/null @@ -1,133 +0,0 @@ -# Copyright (c) 2014 Rackspace Hosting. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os - -from django.utils.translation import ugettext as _ # noqa - -from horizon.test.settings import * # noqa -from horizon.utils import secret_key as secret_key_utils - -from designatedashboard import exceptions - - -TEST_DIR = os.path.dirname(os.path.abspath(__file__)) -ROOT_PATH = os.path.abspath(os.path.join(TEST_DIR, "..")) - -SECRET_KEY = secret_key_utils.generate_or_read_from_file( - os.path.join(TEST_DIR, '.secret_key_store')) -ROOT_URLCONF = 'openstack_dashboard.urls' -TEMPLATE_DIRS = ( - os.path.join(TEST_DIR, 'templates'), -) - -TEMPLATE_CONTEXT_PROCESSORS += ( - 'openstack_dashboard.context_processors.openstack', -) - -INSTALLED_APPS = ( - 'django.contrib.contenttypes', - 'django.contrib.auth', - 'django.contrib.sessions', - 'django.contrib.staticfiles', - 'django.contrib.messages', - 'django.contrib.humanize', - 'django_nose', - 'openstack_auth', - 'compressor', - 'horizon', - 'openstack_dashboard', - 'openstack_dashboard.dashboards.project', - 'openstack_dashboard.dashboards.admin', - 'designatedashboard.dashboards.project.dns_domains', - 'openstack_dashboard.dashboards.settings', -) - -AUTHENTICATION_BACKENDS = ('openstack_auth.backend.KeystoneBackend',) - -SITE_BRANDING = 'OpenStack' - -HORIZON_CONFIG = { - 'dashboards': ('project', 'admin', 'infrastructure', 'settings'), - 'default_dashboard': 'project', - "password_validator": { - "regex": '^.{8,18}$', - "help_text": _("Password must be between 8 and 18 characters.") - }, - 'user_home': None, - 'help_url': "http://docs.openstack.org", - 'exceptions': {'recoverable': exceptions.RECOVERABLE, - 'not_found': exceptions.NOT_FOUND, - 'unauthorized': exceptions.UNAUTHORIZED}, -} - -# Set to True to allow users to upload images to glance via Horizon server. -# When enabled, a file form field will appear on the create image form. -# See documentation for deployment considerations. -HORIZON_IMAGES_ALLOW_UPLOAD = True - -OPENSTACK_KEYSTONE_URL = "http://localhost:5000/v2.0" -OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member" - -OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True -OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'test_domain' - -OPENSTACK_KEYSTONE_BACKEND = { - 'name': 'native', - 'can_edit_user': True, - 'can_edit_group': True, - 'can_edit_project': True, - 'can_edit_domain': True, - 'can_edit_role': True -} - -OPENSTACK_HYPERVISOR_FEATURES = { - 'can_set_mount_point': True, - - # NOTE: as of Grizzly this is not yet supported in Nova so enabling this - # setting will not do anything useful - 'can_encrypt_volumes': False -} - -LOGGING['loggers']['openstack_dashboard'] = { - 'handlers': ['test'], - 'propagate': False, -} - -SECURITY_GROUP_RULES = { - 'all_tcp': { - 'name': 'ALL TCP', - 'ip_protocol': 'tcp', - 'from_port': '1', - 'to_port': '65535', - }, - 'http': { - 'name': 'HTTP', - 'ip_protocol': 'tcp', - 'from_port': '80', - 'to_port': '80', - }, -} - -NOSE_ARGS = ['--nocapture', - '--nologcapture', - '--cover-package=openstack_dashboard', - '--cover-inclusive', - '--all-modules'] - -DESIGNATE_ENDPOINT_URL = "http://127.0.0.1:8000" - -DATABASES = ( - {'default': {'NAME': 'test', 'ENGINE': 'django.db.backends.sqlite3'}}) diff --git a/contrib/designate-dashboard/designatedashboard/tests/test_designatedashboard.py b/contrib/designate-dashboard/designatedashboard/tests/test_designatedashboard.py deleted file mode 100644 index 5dbed17a0..000000000 --- a/contrib/designate-dashboard/designatedashboard/tests/test_designatedashboard.py +++ /dev/null @@ -1,448 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2012 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. -# All Rights Reserved. -# -# Copyright 2012 Nebula, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -from __future__ import unicode_literals - -from django.core.urlresolvers import reverse # noqa -from django import http - -from mox import IsA # noqa - -from designatedashboard import api - -from openstack_dashboard.test import helpers as test - -from designatedashboard.dashboards.project.dns_domains import forms - - -DOMAIN_ID = '123' -INDEX_URL = reverse('horizon:project:dns_domains:index') -RECORDS_URL = reverse('horizon:project:dns_domains:records', args=[DOMAIN_ID]) - - -class DNSDomainsTests(test.TestCase): - - def setUp(self): - super(DNSDomainsTests, self).setUp() - - @test.create_stubs( - {api.designate: ('domain_list',)}) - def test_index(self): - domains = self.dns_domains.list() - api.designate.domain_list( - IsA(http.HttpRequest)).AndReturn(domains) - self.mox.ReplayAll() - - res = self.client.get(INDEX_URL) - - self.assertTemplateUsed(res, 'project/dns_domains/index.html') - self.assertEqual(len(res.context['table'].data), len(domains)) - - @test.create_stubs( - {api.designate: ('domain_get', 'server_list', 'record_list')}) - def test_records(self): - domain_id = '123' - domain = self.dns_domains.first() - servers = self.dns_servers.list() - records = self.dns_records.list() - - api.designate.domain_get( - IsA(http.HttpRequest), - domain_id).AndReturn(domain) - - api.designate.server_list( - IsA(http.HttpRequest), - domain_id).AndReturn(servers) - - api.designate.record_list( - IsA(http.HttpRequest), - domain_id).AndReturn(records) - - self.mox.ReplayAll() - - res = self.client.get(RECORDS_URL) - - self.assertTemplateUsed(res, 'project/dns_domains/records.html') - self.assertEqual(len(res.context['table'].data), len(records)) - - -class BaseRecordFormCleanTests(test.TestCase): - - DOMAIN_NAME = 'foo.com.' - HOSTNAME = 'www.foo.com.' - - MSG_FIELD_REQUIRED = 'This field is required' - MSG_INVALID_HOSTNAME = 'Enter a valid hostname' - MSG_OUTSIDE_DOMAIN = 'Name must be in the current domain' - - def setUp(self): - super(BaseRecordFormCleanTests, self).setUp() - - # Request object with messages support - self.request = self.factory.get('', {}) - - # Set-up form instance - self.form = forms.RecordCreate(self.request) - self.form._errors = {} - self.form.cleaned_data = { - 'domain_name': self.DOMAIN_NAME, - 'name': '', - 'data': '', - 'txt': '', - 'priority': None, - 'ttl': None, - } - - def assert_no_errors(self): - self.assertEqual(self.form._errors, {}) - - def assert_error(self, field, msg): - self.assertIn(msg, self.form._errors[field]) - - def assert_required_error(self, field): - self.assert_error(field, self.MSG_FIELD_REQUIRED) - - -class ARecordFormTests(BaseRecordFormCleanTests): - - IPV4 = '1.1.1.1' - - MSG_INVALID_IPV4 = 'Enter a valid IPv4 address' - - def setUp(self): - super(ARecordFormTests, self).setUp() - self.form.cleaned_data['type'] = 'A' - self.form.cleaned_data['name'] = self.HOSTNAME - self.form.cleaned_data['data'] = self.IPV4 - - def test_valid_field_values(self): - self.form.clean() - self.assert_no_errors() - - def test_valid_name_field_wild_card(self): - self.form.cleaned_data['name'] = '*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_no_errors() - - def test_missing_name_field(self): - self.form.cleaned_data['name'] = '' - self.form.clean() - self.assert_required_error('name') - - def test_missing_data_field(self): - self.form.cleaned_data['data'] = '' - self.form.clean() - self.assert_required_error('data') - - def test_invalid_name_field(self): - self.form.cleaned_data['name'] = 'foo' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_starting_dash(self): - self.form.cleaned_data['name'] = '-ww.foo.com' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_trailing_dash(self): - self.form.cleaned_data['name'] = 'www.foo.co-' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_bad_wild_card(self): - self.form.cleaned_data['name'] = 'derp.*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_outside_of_domain_name_field(self): - self.form.cleaned_data['name'] = 'www.bar.com.' - self.form.clean() - self.assert_error('name', self.MSG_OUTSIDE_DOMAIN) - - def test_invalid_data_field(self): - self.form.cleaned_data['data'] = 'foo' - self.form.clean() - self.assert_error('data', self.MSG_INVALID_IPV4) - - -class AAAARecordFormTests(BaseRecordFormCleanTests): - - IPV6 = '1111:1111:1111:11::1' - - MSG_INVALID_IPV6 = 'Enter a valid IPv6 address' - - def setUp(self): - super(AAAARecordFormTests, self).setUp() - self.form.cleaned_data['type'] = 'AAAA' - self.form.cleaned_data['name'] = self.HOSTNAME - self.form.cleaned_data['data'] = self.IPV6 - - def test_valid_field_values(self): - self.form.clean() - self.assert_no_errors() - - def test_valid_name_field_wild_card(self): - self.form.cleaned_data['name'] = '*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_no_errors() - - def test_missing_name_field(self): - self.form.cleaned_data['name'] = '' - self.form.clean() - self.assert_required_error('name') - - def test_missing_data_field(self): - self.form.cleaned_data['data'] = '' - self.form.clean() - self.assert_required_error('data') - - def test_invalid_name_field(self): - self.form.cleaned_data['name'] = 'foo' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_starting_dash(self): - self.form.cleaned_data['name'] = '-ww.foo.com' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_trailing_dash(self): - self.form.cleaned_data['name'] = 'www.foo.co-' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_bad_wild_card(self): - self.form.cleaned_data['name'] = 'derp.*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_outside_of_domain_name_field(self): - self.form.cleaned_data['name'] = 'www.bar.com.' - self.form.clean() - self.assert_error('name', self.MSG_OUTSIDE_DOMAIN) - - def test_invalid_data_field(self): - self.form.cleaned_data['data'] = 'foo' - self.form.clean() - self.assert_error('data', self.MSG_INVALID_IPV6) - - -class CNAMERecordFormTests(BaseRecordFormCleanTests): - - CNAME = 'bar.foo.com.' - - def setUp(self): - super(CNAMERecordFormTests, self).setUp() - self.form.cleaned_data['type'] = 'CNAME' - self.form.cleaned_data['name'] = self.HOSTNAME - self.form.cleaned_data['data'] = self.CNAME - - def test_valid_field_values(self): - self.form.clean() - self.assert_no_errors() - - def test_valid_name_field_wild_card(self): - self.form.cleaned_data['name'] = '*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_no_errors() - - def test_missing_name_field(self): - self.form.cleaned_data['name'] = '' - self.form.clean() - self.assert_required_error('name') - - def test_missing_data_field(self): - self.form.cleaned_data['data'] = '' - self.form.clean() - self.assert_required_error('data') - - def test_invalid_name_field(self): - self.form.cleaned_data['name'] = 'foo' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_starting_dash(self): - self.form.cleaned_data['name'] = '-ww.foo.com' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_trailing_dash(self): - self.form.cleaned_data['name'] = 'www.foo.co-' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_bad_wild_card(self): - self.form.cleaned_data['name'] = 'derp.*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_outside_of_domain_name_field(self): - self.form.cleaned_data['name'] = 'www.bar.com.' - self.form.clean() - self.assert_error('name', self.MSG_OUTSIDE_DOMAIN) - - def test_invalid_data_field(self): - self.form.cleaned_data['data'] = 'foo' - self.form.clean() - self.assert_error('data', self.MSG_INVALID_HOSTNAME) - - -class MXRecordFormTests(BaseRecordFormCleanTests): - - MAIL_SERVER = 'mail.foo.com.' - PRIORITY = 10 - - def setUp(self): - super(MXRecordFormTests, self).setUp() - self.form.cleaned_data['type'] = 'MX' - self.form.cleaned_data['data'] = self.MAIL_SERVER - self.form.cleaned_data['priority'] = self.PRIORITY - - def test_valid_field_values(self): - self.form.clean() - self.assert_no_errors() - - def test_missing_data_field(self): - self.form.cleaned_data['data'] = '' - self.form.clean() - self.assert_required_error('data') - - def test_missing_priority_field(self): - self.form.cleaned_data['priority'] = None - self.form.clean() - self.assert_required_error('priority') - - def test_invalid_data_field(self): - self.form.cleaned_data['data'] = 'foo' - self.form.clean() - self.assert_error('data', self.MSG_INVALID_HOSTNAME) - - def test_default_assignment_name_field(self): - self.form.clean() - self.assertEqual(self.DOMAIN_NAME, self.form.cleaned_data['name']) - - -class TXTRecordFormTests(BaseRecordFormCleanTests): - - TEXT = 'Lorem ipsum' - - def setUp(self): - super(TXTRecordFormTests, self).setUp() - self.form.cleaned_data['type'] = 'TXT' - self.form.cleaned_data['name'] = self.HOSTNAME - self.form.cleaned_data['txt'] = self.TEXT - - def test_valid_field_values(self): - self.form.clean() - self.assert_no_errors() - - def test_valid_name_field_wild_card(self): - self.form.cleaned_data['name'] = '*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_no_errors() - - def test_missing_name_field(self): - self.form.cleaned_data['name'] = '' - self.form.clean() - self.assert_required_error('name') - - def test_missing_txt_field(self): - self.form.cleaned_data['txt'] = '' - self.form.clean() - self.assert_required_error('txt') - - def test_invalid_name_field(self): - self.form.cleaned_data['name'] = 'foo' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_starting_dash(self): - self.form.cleaned_data['name'] = '-ww.foo.com' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_trailing_dash(self): - self.form.cleaned_data['name'] = 'www.foo.co-' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_invalid_name_field_bad_wild_card(self): - self.form.cleaned_data['name'] = 'derp.*.' + self.DOMAIN_NAME - self.form.clean() - self.assert_error('name', self.MSG_INVALID_HOSTNAME) - - def test_outside_of_domain_name_field(self): - self.form.cleaned_data['name'] = 'www.bar.com.' - self.form.clean() - self.assert_error('name', self.MSG_OUTSIDE_DOMAIN) - - def test_default_assignment_data_field(self): - self.form.clean() - self.assertEqual(self.TEXT, self.form.cleaned_data['data']) - - -class SRVRecordFormTests(BaseRecordFormCleanTests): - - SRV_NAME = '_foo._tcp.' - SRV_DATA = '1 1 srv.foo.com.' - PRIORITY = 10 - - MSG_INVALID_SRV_NAME = 'Enter a valid SRV name' - MSG_INVALID_SRV_DATA = 'Enter a valid SRV record' - - def setUp(self): - super(SRVRecordFormTests, self).setUp() - self.form.cleaned_data['type'] = 'SRV' - self.form.cleaned_data['name'] = self.SRV_NAME - self.form.cleaned_data['data'] = self.SRV_DATA - self.form.cleaned_data['priority'] = self.PRIORITY - - def test_valid_field_values(self): - self.form.clean() - self.assert_no_errors() - - def test_missing_name_field(self): - self.form.cleaned_data['name'] = '' - self.form.clean() - self.assert_required_error('name') - - def test_missing_data_field(self): - self.form.cleaned_data['data'] = '' - self.form.clean() - self.assert_required_error('data') - - def test_missing_priority_field(self): - self.form.cleaned_data['priority'] = None - self.form.clean() - self.assert_required_error('priority') - - def test_invalid_name_field(self): - self.form.cleaned_data['name'] = 'foo' - self.form.clean() - self.assert_error('name', self.MSG_INVALID_SRV_NAME) - - def test_invalid_data_field(self): - self.form.cleaned_data['data'] = 'foo' - self.form.clean() - self.assert_error('data', self.MSG_INVALID_SRV_DATA) - - def test_default_assignment_name_field(self): - self.form.clean() - self.assertEqual(self.SRV_NAME + self.DOMAIN_NAME, - self.form.cleaned_data['name']) diff --git a/contrib/designate-dashboard/doc/source/conf.py b/contrib/designate-dashboard/doc/source/conf.py deleted file mode 100755 index c7ddc9579..000000000 --- a/contrib/designate-dashboard/doc/source/conf.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- coding: utf-8 -*- -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless reqdashboardred by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import sys - -sys.path.insert(0, os.path.abspath('../..')) -# -- General configuration ---------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = [ - 'sphinx.ext.autodoc', - #'sphinx.ext.intersphinx', - 'oslosphinx' -] - -# autodoc generation is a bit aggressive and a ndashboardsance when doing heavy -# text edit cycles. -# execute "export SPHINX_DEBUG=1" in your terminal to disable - -# The suffix of source filenames. -source_suffix = '.rst' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'designate_dashboard' -copyright = u'2013, OpenStack Foundation' - -# If true, '()' will be appended to :func: etc. cross-reference text. -add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -add_module_names = True - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# -- Options for HTML output -------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. Major themes that come with -# Sphinx are currently 'default' and 'sphinxdoc'. -# html_theme_path = ["."] -# html_theme = '_theme' -# html_static_path = ['static'] - -# Output file base name for HTML help bdashboardlder. -htmlhelp_basename = '%sdoc' % project - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass -# [howto/manual]). -latex_documents = [ - ('index', - '%s.tex' % project, - u'%s Documentation' % project, - u'OpenStack Foundation', 'manual'), -] - -# Example configuration for intersphinx: refer to the Python standard library. -#intersphinx_mapping = {'http://docs.python.org/': None} \ No newline at end of file diff --git a/contrib/designate-dashboard/doc/source/contributing.rst b/contrib/designate-dashboard/doc/source/contributing.rst deleted file mode 100644 index ed77c1262..000000000 --- a/contrib/designate-dashboard/doc/source/contributing.rst +++ /dev/null @@ -1,4 +0,0 @@ -============ -Contributing -============ -.. include:: ../../CONTRIBUTING.rst \ No newline at end of file diff --git a/contrib/designate-dashboard/doc/source/index.rst b/contrib/designate-dashboard/doc/source/index.rst deleted file mode 100644 index a747d6639..000000000 --- a/contrib/designate-dashboard/doc/source/index.rst +++ /dev/null @@ -1,24 +0,0 @@ -.. designate_ui documentation master file, created by - sphinx-quickstart on Tue Jul 9 22:26:36 2013. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to designatedashboard's documentation! -======================================================== - -Contents: - -.. toctree:: - :maxdepth: 2 - - readme - installation - usage - contributing - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/contrib/designate-dashboard/doc/source/installation.rst b/contrib/designate-dashboard/doc/source/installation.rst deleted file mode 100644 index af26cf0c5..000000000 --- a/contrib/designate-dashboard/doc/source/installation.rst +++ /dev/null @@ -1,12 +0,0 @@ -============ -Installation -============ - -At the command line:: - - $ pip install designate_dashboard - -Or, if you have virtualenvwrapper installed:: - - $ mkvirtualenv designate_dashboard - $ pip install designate_dashboard \ No newline at end of file diff --git a/contrib/designate-dashboard/doc/source/readme.rst b/contrib/designate-dashboard/doc/source/readme.rst deleted file mode 100644 index 38ba8043d..000000000 --- a/contrib/designate-dashboard/doc/source/readme.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../../README.rst \ No newline at end of file diff --git a/contrib/designate-dashboard/doc/source/usage.rst b/contrib/designate-dashboard/doc/source/usage.rst deleted file mode 100644 index 8ca3de41c..000000000 --- a/contrib/designate-dashboard/doc/source/usage.rst +++ /dev/null @@ -1,7 +0,0 @@ -======== -Usage -======== - -To use designate_dashboard in a project:: - - import designate_dashboard \ No newline at end of file diff --git a/contrib/designate-dashboard/openstack-common.conf b/contrib/designate-dashboard/openstack-common.conf deleted file mode 100644 index 1d8dcca0b..000000000 --- a/contrib/designate-dashboard/openstack-common.conf +++ /dev/null @@ -1,6 +0,0 @@ -[DEFAULT] - -# The list of modules to copy from oslo-incubator.git - -# The base module to hold the copy of openstack.common -base=designatedashboard diff --git a/contrib/designate-dashboard/requirements.txt b/contrib/designate-dashboard/requirements.txt deleted file mode 100644 index 11a5e1e0b..000000000 --- a/contrib/designate-dashboard/requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -# The order of packages is significant, because pip processes them in the order -# of appearance. Changing the order has an impact on the overall integration -# process, which may cause wedges in the gate later. -pbr>=0.11,<2.0 -# Horizon Core Requirements -Django>=1.4.2,<1.8 -django_compressor>=1.4 -django_openstack_auth>=1.1.7,!=1.1.8 -Babel>=1.3 -python-designateclient>=1.0.0 diff --git a/contrib/designate-dashboard/setup.cfg b/contrib/designate-dashboard/setup.cfg deleted file mode 100644 index 48d352d29..000000000 --- a/contrib/designate-dashboard/setup.cfg +++ /dev/null @@ -1,46 +0,0 @@ -[metadata] -name = designatedashboard -summary = Designate Horizon UI bits -description-file = - README.rst -author = OpenStack -author-email = openstack-dev@lists.openstack.org -home-page = http://www.openstack.org/ -classifier = - Environment :: OpenStack - Intended Audience :: Information Technology - Intended Audience :: System Administrators - License :: OSI Approved :: Apache Software License - Operating System :: POSIX :: Linux - Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 - Programming Language :: Python :: 2.6 - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.3 - -[files] -packages = - designatedashboard - -[build_sphinx] -source-dir = doc/source -build-dir = doc/build -all_files = 1 - -[upload_sphinx] -upload-dir = doc/build/html - -[compile_catalog] -directory = designatedashboard/locale -domain = designatedashboard - -[update_catalog] -domain = designatedashboard -output_dir = designatedashboard/locale -input_file = designatedashboard/locale/designatedashboard.pot - -[extract_messages] -keywords = _ gettext ngettext l_ lazy_gettext -mapping_file = babel.cfg -output_file = designatedashboard/locale/designatedashboard.pot \ No newline at end of file diff --git a/contrib/designate-dashboard/setup.py b/contrib/designate-dashboard/setup.py deleted file mode 100755 index 736375744..000000000 --- a/contrib/designate-dashboard/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT -import setuptools - -# In python < 2.7.4, a lazy loading of package `pbr` will break -# setuptools if some other modules registered functions in `atexit`. -# solution from: http://bugs.python.org/issue15881#msg170215 -try: - import multiprocessing # noqa -except ImportError: - pass - -setuptools.setup( - setup_requires=['pbr'], - pbr=True) diff --git a/contrib/designate-dashboard/test b/contrib/designate-dashboard/test deleted file mode 100644 index dd690e30fb899c8f50d20c98f0e24369a7db770f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2048 zcmWFz^vNtqRY=P(%1ta$FlJz3U}R))P*7lCV2}V}CMafv@>zg141mN40SN}(XH2{x lRY0B0+XyKil^+d((GVai1iXk+HL7Sd1V%$(Gz4&l0041E2rvKu diff --git a/contrib/designate-dashboard/test-requirements.txt b/contrib/designate-dashboard/test-requirements.txt deleted file mode 100644 index 5b037dd93..000000000 --- a/contrib/designate-dashboard/test-requirements.txt +++ /dev/null @@ -1,17 +0,0 @@ -# The order of packages is significant, because pip processes them in the order -# of appearance. Changing the order has an impact on the overall integration -# process, which may cause wedges in the gate later. -hacking>=0.10.0,<0.11 - -coverage>=3.6 -discover -mock>=1.0 -mox>=0.5.3 -oslo.config>=1.11.0 # Apache-2.0 -pylint==1.4.1 # GNU GPL v2 -testrepository>=0.0.18 -testtools>=0.9.36,!=1.2.0 -unittest2 -django-nose>=1.2 - --e git+https://github.com/openstack/horizon.git#egg=horizon diff --git a/contrib/designate-dashboard/tox.ini b/contrib/designate-dashboard/tox.ini deleted file mode 100644 index 53aa727df..000000000 --- a/contrib/designate-dashboard/tox.ini +++ /dev/null @@ -1,34 +0,0 @@ -[tox] -minversion = 1.6 -envlist = py26,py27,py33,pypy,pep8 -skipsdist = True - -[testenv] -usedevelop = True -install_command = pip install -U {opts} {packages} -setenv = - VIRTUAL_ENV={envdir} -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt -commands = python setup.py testr --slowest --testr-args='{posargs}' - -[testenv:pep8] -commands = flake8 - -[testenv:venv] -commands = {posargs} - -[testenv:cover] -commands = python setup.py testr --coverage --testr-args='{posargs}' - -[testenv:docs] -commands = python setup.py build_sphinx - -[flake8] -# H803 skipped on purpose per list discussion. -# E123, E125 skipped as they are invalid PEP-8. - -show-source = True -ignore = E123,E125,H803 -builtins = _ -exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build \ No newline at end of file diff --git a/contrib/devstack/lib/designate b/contrib/devstack/lib/designate index 70709cc68..c15087239 100644 --- a/contrib/devstack/lib/designate +++ b/contrib/devstack/lib/designate @@ -27,11 +27,14 @@ DESIGNATE_REPO=${DESIGNATE_REPO:-${GIT_BASE}/openstack/designate.git} DESIGNATE_BRANCH=${DESIGNATE_BRANCH:-master} DESIGNATECLIENT_REPO=${DESIGNATECLIENT_REPO:-${GIT_BASE}/openstack/python-designateclient.git} DESIGNATECLIENT_BRANCH=${DESIGNATECLIENT_BRANCH:-master} +DESIGNATEDASHBOARD_REPO=${DESIGNATEDASHBOARD_REPO:-${GIT_BASE}/openstack/designate-dashboard.git} +DESIGNATEDASHBOARD_BRANCH=${DESIGNATEDASHBOARD_BRANCH:-master} # Set up default paths DESIGNATE_BIN_DIR=$(get_python_exec_prefix) DESIGNATE_DIR=$DEST/designate DESIGNATECLIENT_DIR=$DEST/python-designateclient +DESIGNATEDASHBOARD_DIR=$DEST/designate-dashboard DESIGNATE_CONF_DIR=/etc/designate DESIGNATE_STATE_PATH=${DESIGNATE_STATE_PATH:=$DATA_DIR/designate} DESIGNATE_CONF=$DESIGNATE_CONF_DIR/designate.conf @@ -284,9 +287,10 @@ function install_designateclient { # install_designatedashboard - Collect source and prepare function install_designatedashboard { - ln -fs $DESIGNATE_DIR/contrib/designate-dashboard/designatedashboard/enabled/_70_dns_add_group.py $HORIZON_DIR/openstack_dashboard/local/enabled/70_dns_add_group.py - ln -fs $DESIGNATE_DIR/contrib/designate-dashboard/designatedashboard/enabled/_71_dns_project.py $HORIZON_DIR/openstack_dashboard/local/enabled/71_dns_project.py - setup_develop $DESIGNATE_DIR/contrib/designate-dashboard + git_clone $DESIGNATEDASHBOARD_REPO $DESIGNATEDASHBOARD_DIR $DESIGNATEDASHBOARD_BRANCH + setup_develop $DESIGNATEDASHBOARD_DIR + ln -fs $DESIGNATEDASHBOARD_DIR/designatedashboard/enabled/_70_dns_add_group.py $HORIZON_DIR/openstack_dashboard/local/enabled/70_dns_add_group.py + ln -fs $DESIGNATEDASHBOARD_DIR/designatedashboard/enabled/_71_dns_project.py $HORIZON_DIR/openstack_dashboard/local/enabled/71_dns_project.py } # start_designate - Start running processes, including screen diff --git a/contrib/vagrant/Vagrantfile b/contrib/vagrant/Vagrantfile index 7e90d1649..75cf9bef2 100644 --- a/contrib/vagrant/Vagrantfile +++ b/contrib/vagrant/Vagrantfile @@ -22,6 +22,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| override.vm.synced_folder "../../../python-designateclient", "/opt/stack/python-designateclient" end + if File.directory?("../../../designate-dashboard") + override.vm.synced_folder "../../../designate-dashboard", "/opt/stack/designate-dashboard" + end + if File.directory?("../../../../openstack/rally") override.vm.synced_folder "../../../../openstack/rally", "/opt/stack/rally" end @@ -42,6 +46,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| override.vm.synced_folder "../../../python-designateclient", "/opt/stack/python-designateclient", type: "nfs" end + if File.directory?("../../../designate-dashboard") + override.vm.synced_folder "../../../designate-dashboard", "/opt/stack/designate-dashboard", type: "nfs" + end + if File.directory?("../../../../openstack/rally") override.vm.synced_folder "../../../../openstack/rally", "/opt/stack/rally", type: "nfs" end diff --git a/tox.ini b/tox.ini index 8cb2c9a6e..54c74c8b0 100644 --- a/tox.ini +++ b/tox.ini @@ -80,7 +80,7 @@ commands = {posargs} ignore = H302,H306,H402,H404,H405,H904,E126,E128 builtins = _ -exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*openstack/deprecated*,*lib/python*,*egg,build,tools,contrib/designate-dashboard +exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*openstack/deprecated*,*lib/python*,*egg,build,tools [hacking] local-check-factory = designate.hacking.checks.factory