Rename dynamic_ui package and normalize it.

* Move muranodashboard.environments.services package to
  muranodashboard.dynamic_ui.
* Move all code from dynamic_ui/__init__.py to dynamic_ui/services.py
  thus having normal empty __init__.py for dynamic_ui package (as in
  other packages).

Change-Id: I395ee621578cb417314fe4960d74108deb848023
This commit is contained in:
Timur Sufiev
2013-12-19 21:02:32 +04:00
parent a873447045
commit 950dd8312d
15 changed files with 44 additions and 28 deletions

View File

@@ -0,0 +1,13 @@
# Copyright (c) 2013 Mirantis, 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.

View File

@@ -14,13 +14,15 @@
import re import re
import logging import logging
import types
from django import forms from django import forms
from django.core.validators import RegexValidator from django.core.validators import RegexValidator
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import muranodashboard.environments.services.fields as fields import muranodashboard.dynamic_ui.fields as fields
import muranodashboard.environments.services.helpers as helpers import muranodashboard.dynamic_ui.helpers as helpers
import yaql import yaql
import types
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View File

@@ -19,7 +19,8 @@ import tarfile
import logging import logging
import shutil import shutil
import hashlib import hashlib
from ..consts import CHUNK_SIZE, CACHE_DIR, ARCHIVE_PKG_PATH from muranodashboard.environments.consts import CHUNK_SIZE, CACHE_DIR, \
ARCHIVE_PKG_PATH
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View File

@@ -12,10 +12,13 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import os import os
import re import re
import time import time
import logging import logging
from muranodashboard.dynamic_ui import metadata
try: try:
from collections import OrderedDict from collections import OrderedDict
except ImportError: # python2.6 except ImportError: # python2.6
@@ -24,8 +27,7 @@ import yaml
from yaml.scanner import ScannerError from yaml.scanner import ScannerError
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import copy import copy
from ..consts import CACHE_REFRESH_SECONDS_INTERVAL from muranodashboard.environments.consts import CACHE_REFRESH_SECONDS_INTERVAL
import metadata
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
_all_services = OrderedDict() _all_services = OrderedDict()
@@ -35,7 +37,7 @@ _current_cache_hash = None
class Service(object): class Service(object):
def __init__(self, **kwargs): def __init__(self, **kwargs):
import muranodashboard.environments.services.forms as services import muranodashboard.dynamic_ui.forms as services
for key, value in kwargs.iteritems(): for key, value in kwargs.iteritems():
if key == 'forms': if key == 'forms':
self.forms = [] self.forms = []
@@ -66,7 +68,7 @@ class Service(object):
def import_service(full_service_name, service_file): def import_service(full_service_name, service_file):
from muranodashboard.environments.services.helpers import decamelize from muranodashboard.dynamic_ui.helpers import decamelize
try: try:
with open(service_file) as stream: with open(service_file) as stream:
yaml_desc = yaml.load(stream) yaml_desc = yaml.load(stream)

View File

@@ -18,7 +18,7 @@ from django.conf import settings
from horizon.exceptions import ServiceCatalogException from horizon.exceptions import ServiceCatalogException
from openstack_dashboard.api.base import url_for from openstack_dashboard.api.base import url_for
from muranoclient.v1.client import Client from muranoclient.v1.client import Client
from muranodashboard.environments.services import get_service_name from muranodashboard.dynamic_ui.services import get_service_name
from muranoclient.common.exceptions import HTTPForbidden, HTTPNotFound from muranoclient.common.exceptions import HTTPForbidden, HTTPNotFound
from consts import STATUS_ID_READY, STATUS_ID_NEW from consts import STATUS_ID_READY, STATUS_ID_NEW
from .network import get_network_params from .network import get_network_params

View File

@@ -16,8 +16,8 @@ import logging
import json import json
from django import forms from django import forms
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from .services import get_service_choices from muranodashboard.dynamic_ui.services import get_service_choices
from .services.fields import get_murano_images from muranodashboard.dynamic_ui.fields import get_murano_images
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View File

@@ -21,8 +21,8 @@ from views import DetailServiceView
from views import DeploymentsView from views import DeploymentsView
from views import Wizard, EditEnvironmentView from views import Wizard, EditEnvironmentView
from forms import ChoiceServiceFormFactory from forms import ChoiceServiceFormFactory
from services import get_service_checkers from muranodashboard.dynamic_ui.services import get_service_checkers
from services import make_forms_getter from muranodashboard.dynamic_ui.services import make_forms_getter
from openstack_dashboard.dashboards.project.instances.views import DetailView from openstack_dashboard.dashboards.project.instances.views import DetailView
VIEW_MOD = 'muranodashboard.environments.views' VIEW_MOD = 'muranodashboard.environments.views'

View File

@@ -16,12 +16,12 @@ import logging
import re import re
import copy import copy
import json import json
from functools import update_wrapper
from django.core.urlresolvers import reverse, reverse_lazy from django.core.urlresolvers import reverse, reverse_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.contrib.formtools.wizard.views import SessionWizardView from django.contrib.formtools.wizard.views import SessionWizardView
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from horizon import exceptions from horizon import exceptions
from horizon import tabs from horizon import tabs
from horizon import tables from horizon import tables
@@ -32,18 +32,16 @@ from tables import EnvironmentsTable
from tables import ServicesTable from tables import ServicesTable
from tables import DeploymentsTable from tables import DeploymentsTable
from tables import EnvConfigTable from tables import EnvConfigTable
from workflows import CreateEnvironment, UpdateEnvironment from workflows import CreateEnvironment, UpdateEnvironment
from tabs import ServicesTabs, DeploymentTabs from tabs import ServicesTabs, DeploymentTabs
from . import api from . import api
from muranoclient.common.exceptions import HTTPUnauthorized, \ from muranoclient.common.exceptions import HTTPUnauthorized, \
CommunicationError, HTTPInternalServerError, HTTPForbidden, HTTPNotFound CommunicationError, HTTPInternalServerError, HTTPForbidden, HTTPNotFound
from functools import update_wrapper
from django.utils.decorators import classonlymethod from django.utils.decorators import classonlymethod
from services import get_service_descriptions from muranodashboard.dynamic_ui.services import get_service_descriptions
from services import get_service_name from muranodashboard.dynamic_ui.services import get_service_name
from services import get_service_field_descriptions from muranodashboard.dynamic_ui.services import get_service_field_descriptions
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@@ -19,7 +19,7 @@ from horizon.forms import SelfHandlingForm
from horizon import exceptions from horizon import exceptions
from horizon import messages from horizon import messages
from metadataclient.common.exceptions import HTTPException from metadataclient.common.exceptions import HTTPException
from muranodashboard.environments.services.metadata import metadataclient from muranodashboard.dynamic_ui.metadata import metadataclient
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View File

@@ -21,7 +21,7 @@ from horizon import exceptions
from horizon import tables from horizon import tables
from horizon import messages from horizon import messages
from metadataclient.common.exceptions import HTTPException from metadataclient.common.exceptions import HTTPException
from muranodashboard.environments.services.metadata import metadataclient from muranodashboard.dynamic_ui.metadata import metadataclient
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@@ -15,10 +15,10 @@ import logging
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from .tables import DeleteFileFromService, DownloadFile from .tables import DeleteFileFromService, DownloadFile
from horizon import tables, workflows, forms from horizon import tables, workflows, forms
from muranodashboard.environments.services.forms import UpdatableFieldsForm from muranodashboard.dynamic_ui.forms import UpdatableFieldsForm
from muranodashboard.environments.services.fields import TableField from muranodashboard.dynamic_ui.fields import TableField
from muranodashboard.environments.services.fields import Column, CheckColumn from muranodashboard.dynamic_ui.fields import Column, CheckColumn
from muranodashboard.environments.services.fields import RadioColumn from muranodashboard.dynamic_ui.fields import RadioColumn
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@@ -28,7 +28,7 @@ from .utils import define_tables
from .utils import STEP_NAMES from .utils import STEP_NAMES
from .forms import UploadServiceForm, UploadFileForm, UploadFileToService from .forms import UploadServiceForm, UploadFileForm, UploadFileToService
from .workflows import ComposeService from .workflows import ComposeService
from muranodashboard.environments.services.metadata import metadataclient from muranodashboard.dynamic_ui.metadata import metadataclient
from metadataclient.common.exceptions import CommunicationError, Unauthorized from metadataclient.common.exceptions import CommunicationError, Unauthorized
from metadataclient.common.exceptions import HTTPInternalServerError, NotFound from metadataclient.common.exceptions import HTTPInternalServerError, NotFound
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@@ -21,7 +21,7 @@ from horizon import exceptions
from horizon import forms from horizon import forms
from horizon import workflows from horizon import workflows
from muranodashboard.environments.services.metadata import metadataclient from muranodashboard.dynamic_ui.metadata import metadataclient
log = logging.getLogger(__name__) log = logging.getLogger(__name__)