diff --git a/.gitignore b/.gitignore
index 5138969c..4ee919e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,22 +17,6 @@ nosetests.xml
pep8.txt
pylint.txt
# Files created by releasenotes build
-releasenotes/build
-reports
-openstack_dashboard/local/*
-!openstack_dashboard/local/local_settings.py.example
-!openstack_dashboard/local/enabled/_50__settings.py.example
-!openstack_dashboard/local/local_settings.d
-openstack_dashboard/local/local_settings.d/*
-!openstack_dashboard/local/local_settings.d/*.example
-openstack_dashboard/test/.secret_key_store
-openstack_dashboard/test/integration_tests/local-horizon.conf
-openstack_dashboard/test/integration_tests/test_reports/
-openstack_dashboard/wsgi/horizon.wsgi
-doc/build/
-doc/source/sourcecode
-/static/
-integration_tests_screenshots/
.venv
.tox
node_modules
diff --git a/cgcs_dashboard/api/ceilometer.py b/cgcs_dashboard/api/ceilometer.py
deleted file mode 100644
index 7be295be..00000000
--- a/cgcs_dashboard/api/ceilometer.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# Copyright (c) 2013-2017 Wind River Systems, Inc.
-#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
-
-from ceilometerclient import client as ceilometer_client
-from django.conf import settings
-from openstack_dashboard.api import base
-
-from horizon.utils.memoized import memoized # noqa
-
-
-class Pipeline(base.APIResourceWrapper):
- """Represents one Ceilometer pipeline entry."""
-
- _attrs = ['name', 'enabled', 'meters', 'location', 'max_bytes',
- 'backup_count', 'compress']
-
- def __init__(self, apipipeline):
- super(Pipeline, self).__init__(apipipeline)
-
-
-@memoized
-def ceilometerclient(request):
- """Initialization of Ceilometer client."""
-
- endpoint = base.url_for(request, 'metering')
- insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
- cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None)
- return ceilometer_client.Client('2', endpoint,
- token=(lambda: request.user.token.id),
- insecure=insecure,
- cacert=cacert)
-
-
-def pipeline_list(request):
- """List the configured pipeline."""
- pipeline_entries = ceilometerclient(request).pipelines.list()
- pipelines = [Pipeline(p) for p in pipeline_entries]
- return pipelines
-
-
-def pipeline_update(request, pipeline_name, some_dict):
- pipeline = ceilometerclient(request).pipelines.update(pipeline_name,
- **some_dict)
- if not pipeline:
- raise ValueError(
- 'No match found for pipeline_name "%s".' % pipeline_name)
- return Pipeline(pipeline)
diff --git a/cgcs_dashboard/api/ceph.py b/cgcs_dashboard/api/ceph.py
deleted file mode 100755
index b2834f8a..00000000
--- a/cgcs_dashboard/api/ceph.py
+++ /dev/null
@@ -1,187 +0,0 @@
-# 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.
-#
-# Copyright (c) 2013-2014 Wind River Systems, Inc.
-#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
-
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-from __future__ import absolute_import
-
-import logging
-
-from cephclient import wrapper
-
-from openstack_dashboard.api import base
-
-LOG = logging.getLogger(__name__)
-
-
-# TODO(wrs) this can be instancized once, or will need to pass request per
-# user?
-def cephwrapper():
- return wrapper.CephWrapper()
-
-
-class Monitor(base.APIDictWrapper):
- __attrs = ['host', 'rank']
-
- def __init__(self, apidict):
- super(Monitor, self).__init__(apidict)
-
-
-class OSD(base.APIDictWrapper):
- __attrs = ['id', 'name', 'host', 'status']
-
- def __init__(self, apidict):
- super(OSD, self).__init__(apidict)
-
-
-class Cluster(base.APIDictWrapper):
- _attrs = ['fsid', 'status', 'health', 'detail']
-
- def __init__(self, apidict):
- super(Cluster, self).__init__(apidict)
-
-
-class Storage(base.APIDictWrapper):
- _attrs = ['total', 'used', 'available',
- 'writes_per_sec', 'operations_per_sec']
-
- def __init__(self, apidict):
- super(Storage, self).__init__(apidict)
-
-
-def _Bytes_to_MiB(value_B):
- return (value_B / (1024 * 1024))
-
-
-def _Bytes_to_GiB(value_B):
- return (value_B / (1024 * 1024 * 1024))
-
-
-def cluster_get():
- # the json response doesn't give all the information
- response, text_body = cephwrapper().health(body='text')
- # ceph is not up, raise exception
- if not response.ok:
- response.raise_for_status()
- health_info = text_body.split(' ', 1)
-
- # if health is ok, there will be no details so just show HEALTH_OK
- if len(health_info) > 1:
- detail = health_info[1]
- else:
- detail = health_info[0]
-
- response, cluster_uuid = cephwrapper().fsid(body='text')
- if not response.ok:
- cluster_uuid = None
-
- cluster = {
- 'fsid': cluster_uuid,
- 'health': health_info[0],
- 'detail': detail,
- }
-
- return Cluster(cluster)
-
-
-def storage_get():
- # # Space info
- response, body = cephwrapper().df(body='json')
- # return no space info
- if not response.ok:
- response.raise_for_status()
- stats = body['output']['stats']
- space = {
- 'total': _Bytes_to_GiB(stats['total_bytes']),
- 'used': _Bytes_to_MiB(stats['total_used_bytes']),
- 'available': _Bytes_to_GiB(stats['total_avail_bytes']),
- }
-
- # # I/O info
- response, body = cephwrapper().osd_pool_stats(body='json',
- name='cinder-volumes')
- if not response.ok:
- response.raise_for_status()
- stats = body['output'][0]['client_io_rate']
- # not showing reads/sec at the moment
- # reads_per_sec = stats['read_bytes_sec'] if (
- # 'read_bytes_sec' in stats) else 0
- writes_per_sec = stats['write_bytes_sec'] if (
- 'write_bytes_sec' in stats) else 0
- operations_per_sec = stats['op_per_sec'] if ('op_per_sec' in stats) else 0
- io = {
- 'writes_per_sec': writes_per_sec / 1024,
- 'operations_per_sec': operations_per_sec
- }
-
- storage = {}
- storage.update(space)
- storage.update(io)
-
- return Storage(storage)
-
-
-def _get_quorum_status(mon, quorums):
- if mon['rank'] in quorums:
- status = 'up'
- else:
- status = 'down'
- return status
-
-
-def monitor_list():
- response, body = cephwrapper().mon_dump(body='json')
- # return no monitors info
- if not response.ok:
- response.raise_for_status()
-
- quorums = body['output']['quorum']
-
- mons = []
- for mon in body['output']['mons']:
- status = _get_quorum_status(mon, quorums)
- mons.append(
- {'host': mon['name'], 'rank': mon['rank'], 'status': status})
- return [Monitor(m) for m in mons]
-
-
-def osd_list():
- # would use osd_find, but it doesn't give osd's name
- response, tree = cephwrapper().osd_tree(body='json')
- if not response.ok:
- response.raise_for_status()
-
- osds = []
- for node in tree['output']['nodes']:
- # found osd
- if node['type'] == 'osd':
- osd = {}
- osd['id'] = node['id']
- osd['name'] = node['name']
- osd['status'] = node['status']
-
- # check if osd belongs to host
- response, body = cephwrapper().osd_find(body='json', id=osd['id'])
- if response.ok and 'host' in body['output']['crush_location']:
- osd['host'] = body['output']['crush_location']['host']
- # else dont set hostname
-
- osds.append(osd)
-
- return [OSD(o) for o in osds]
diff --git a/cgcs_dashboard/api/rest/__init__.py b/cgcs_dashboard/api/rest/__init__.py
deleted file mode 100755
index 4cd383da..00000000
--- a/cgcs_dashboard/api/rest/__init__.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2014, Rackspace, US, 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.
-"""This package holds the REST API that supports the Horizon dashboard
-Javascript code.
-
-It is not intended to be used outside of Horizon, and makes no promises of
-stability or fitness for purpose outside of that scope.
-
-It does not promise to adhere to the general OpenStack API Guidelines set out
-in https://wiki.openstack.org/wiki/APIChangeGuidelines.
-"""
-
-from openstack_dashboard.api.rest import dc_manager
-from openstack_dashboard.api.rest import sysinv
-
-
-__all__ = [
- 'dc_manager',
- 'sysinv',
-]
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createphysicalvolume.html b/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createphysicalvolume.html
deleted file mode 100755
index 6c2b5cee..00000000
--- a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createphysicalvolume.html
+++ /dev/null
@@ -1,27 +0,0 @@
-{% extends "horizon/common/_modal_form.html" %}
-{% load i18n %}
-
-{% block form_id %}add_physicalvolume_form{% endblock %}
-{% block form_action %}{% url 'horizon:admin:inventory:addphysicalvolume' host_id %}{% endblock %}
-
-{% block modal-header %}{% trans "Create Physical Volume" %}{% endblock %}
-{% block modal-body %}
-
-
-
-
-
{% trans "Description" %}:
-
{% trans "From here you can define the configuration of a new physical volume." %}
-
-{% endblock %}
-
-{% block modal-footer %}
- Cancel
-
-{% endblock %}
-
-
-
-
diff --git a/setup.cfg b/setup.cfg
index 3015b1f0..407c6f0f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,11 +1,9 @@
[metadata]
-name = cgcs-dashboard
-summary = CGCS Dashboard
-description-file =
- README.rst
+name = starlingx-dashboard
+summary = StarlingX Dashboard Panels
author = OpenStack
-author-email = openstack-dev@lists.openstack.org
-home-page = http://docs.openstack.org/developer/horizon/
+author_email = openstack-dev@lists.openstack.org
+home-page = https://wiki.openstack.org/wiki/StarlingX
classifier =
Environment :: OpenStack
Framework :: Django
@@ -21,7 +19,7 @@ classifier =
[files]
packages =
- wrs_dashboard
+ starlingx_dashboard
[build_sphinx]
all_files = 1
diff --git a/setup.py b/setup.py
index 782bb21f..5751d32e 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
+# Copyright (c) 2018 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -26,4 +26,4 @@ except ImportError:
setuptools.setup(
setup_requires=['pbr>=1.8'],
- pbr=True)
+ pbr=True)
\ No newline at end of file
diff --git a/cgcs_dashboard/__init__.py b/starlingx_dashboard/__init__.py
similarity index 100%
rename from cgcs_dashboard/__init__.py
rename to starlingx_dashboard/__init__.py
diff --git a/cgcs_dashboard/api/__init__.py b/starlingx_dashboard/api/__init__.py
similarity index 56%
rename from cgcs_dashboard/api/__init__.py
rename to starlingx_dashboard/api/__init__.py
index fd2aaad6..07ad166b 100755
--- a/cgcs_dashboard/api/__init__.py
+++ b/starlingx_dashboard/api/__init__.py
@@ -10,22 +10,28 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
+#
+# Copyright (c) 2017 Wind River Systems, Inc.
+#
-from cgcs_dashboard.api import ceilometer
-from cgcs_dashboard.api import ceph
-from cgcs_dashboard.api import dc_manager
-from cgcs_dashboard.api import iservice
-from cgcs_dashboard.api import patch
-from cgcs_dashboard.api import sysinv
-from cgcs_dashboard.api import vim
-
+#from cgcs_dashboard.api import dc_manager
+#from cgcs_dashboard.api import iservice
+#from cgcs_dashboard.api import sysinv
+from starlingx_dashboard.api import vim
+from starlingx_dashboard.api import sysinv
+from starlingx_dashboard.api import patch
+# TODO (ediardo): cleanup the imports below
__all__ = [
- "ceilometer",
- "ceph",
- "dc_manager",
- "iservice",
- "patch",
+ "nova",
"sysinv",
"vim",
+ "patch"
+# "ceilometer",
+# "ceph",
+# "dc_manager",
+# "iservice",
+# "patch",
+# "sysinv",
+# "vim",
]
diff --git a/starlingx_dashboard/api/base.py b/starlingx_dashboard/api/base.py
new file mode 100644
index 00000000..bbf38e68
--- /dev/null
+++ b/starlingx_dashboard/api/base.py
@@ -0,0 +1,17 @@
+#
+# Copyright (c) 2018 Intel Corporation
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+from django.conf import settings
+from horizon import exceptions
+import six
+
+def get_request_page_size(request, limit=None):
+ default_limit = getattr(settings, 'API_RESULT_LIMIT', 1000)
+ try:
+ return min(int(limit), default_limit)
+ except Exception:
+ default_page_size = getattr(settings, 'API_RESULT_PAGE_SIZE', 20)
+ return request.session.get('horizon_pagesize', default_page_size)
diff --git a/cgcs_dashboard/api/dc_manager.py b/starlingx_dashboard/api/dc_manager.py
similarity index 77%
rename from cgcs_dashboard/api/dc_manager.py
rename to starlingx_dashboard/api/dc_manager.py
index 7ac5f745..3cd1a2e1 100755
--- a/cgcs_dashboard/api/dc_manager.py
+++ b/starlingx_dashboard/api/dc_manager.py
@@ -1,73 +1,79 @@
-#
-# Copyright (c) 2017 Wind River Systems, Inc.
-#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
-
-
-import logging
-
-from dcmanagerclient.api.v1 import client
-
-from horizon.utils.memoized import memoized # noqa
-
-from openstack_dashboard.api import base
-
-LOG = logging.getLogger(__name__)
-
-
-@memoized
-def dcmanagerclient(request):
- endpoint = base.url_for(request, 'dcmanager', 'adminURL')
- c = client.Client(project_id=request.user.project_id,
- user_id=request.user.id,
- auth_token=request.user.token.id,
- dcmanager_url=endpoint)
- return c
-
-
-class Summary(base.APIResourceWrapper):
- _attrs = ['name', 'critical', 'major', 'minor', 'warnings', 'status']
-
-
-def alarm_summary_list(request):
- summaries = dcmanagerclient(request).alarm_manager.list_alarms()
- return [Summary(summary) for summary in summaries]
-
-
-class Subcloud(base.APIResourceWrapper):
- _attrs = ['subcloud_id', 'name', 'description', 'location',
- 'software_version', 'management_subnet', 'management_state',
- 'availability_status', 'management_start_ip',
- 'management_end_ip', 'management_gateway_ip',
- 'systemcontroller_gateway_ip', 'created_at', 'updated_at',
- 'sync_status', 'endpoint_sync_status', ]
-
-
-def subcloud_list(request):
- subclouds = dcmanagerclient(request).subcloud_manager.list_subclouds()
- return [Subcloud(subcloud) for subcloud in subclouds]
-
-
-def subcloud_create(request, data):
- return dcmanagerclient(request).subcloud_manager.add_subcloud(
- **data.get('data'))
-
-
-def subcloud_update(request, subcloud_id, changes):
- response = dcmanagerclient(request).subcloud_manager.update_subcloud(
- subcloud_id, **changes.get('updated'))
- # Updating returns a list of subclouds for some reason
- return [Subcloud(subcloud) for subcloud in response]
-
-
-def subcloud_delete(request, subcloud_id):
- return dcmanagerclient(request).subcloud_manager.delete_subcloud(
- subcloud_id)
-
-
-def subcloud_generate_config(request, subcloud_id, data):
- return dcmanagerclient(request).subcloud_manager.generate_config_subcloud(
- subcloud_id, **data)
+# 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.
+#
+# Copyright (c) 2017 Wind River Systems, Inc.
+#
+
+import logging
+
+from dcmanagerclient.api.v1 import client
+
+from horizon.utils.memoized import memoized # noqa
+
+from openstack_dashboard.api import base
+
+LOG = logging.getLogger(__name__)
+
+
+@memoized
+def dcmanagerclient(request):
+ endpoint = base.url_for(request, 'dcmanager', 'adminURL')
+ c = client.Client(project_id=request.user.project_id,
+ user_id=request.user.id,
+ auth_token=request.user.token.id,
+ dcmanager_url=endpoint)
+ return c
+
+
+class Summary(base.APIResourceWrapper):
+ _attrs = ['name', 'critical', 'major', 'minor', 'warnings', 'status']
+
+
+def alarm_summary_list(request):
+ summaries = dcmanagerclient(request).alarm_manager.list_alarms()
+ return [Summary(summary) for summary in summaries]
+
+
+class Subcloud(base.APIResourceWrapper):
+ _attrs = ['subcloud_id', 'name', 'description', 'location',
+ 'software_version', 'management_subnet', 'management_state',
+ 'availability_status', 'management_start_ip',
+ 'management_end_ip', 'management_gateway_ip',
+ 'systemcontroller_gateway_ip', 'created_at', 'updated_at',
+ 'sync_status', 'endpoint_sync_status', ]
+
+
+def subcloud_list(request):
+ subclouds = dcmanagerclient(request).subcloud_manager.list_subclouds()
+ return [Subcloud(subcloud) for subcloud in subclouds]
+
+
+def subcloud_create(request, data):
+ return dcmanagerclient(request).subcloud_manager.add_subcloud(
+ **data.get('data'))
+
+
+def subcloud_update(request, subcloud_id, changes):
+ response = dcmanagerclient(request).subcloud_manager.update_subcloud(
+ subcloud_id, **changes.get('updated'))
+ # Updating returns a list of subclouds for some reason
+ return [Subcloud(subcloud) for subcloud in response]
+
+
+def subcloud_delete(request, subcloud_id):
+ return dcmanagerclient(request).subcloud_manager.delete_subcloud(
+ subcloud_id)
+
+
+def subcloud_generate_config(request, subcloud_id, data):
+ return dcmanagerclient(request).subcloud_manager.generate_config_subcloud(
+ subcloud_id, **data)
diff --git a/cgcs_dashboard/api/iservice.py b/starlingx_dashboard/api/iservice.py
similarity index 88%
rename from cgcs_dashboard/api/iservice.py
rename to starlingx_dashboard/api/iservice.py
index 7754bfb5..803a3308 100755
--- a/cgcs_dashboard/api/iservice.py
+++ b/starlingx_dashboard/api/iservice.py
@@ -12,12 +12,6 @@
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
-
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
from __future__ import absolute_import
diff --git a/starlingx_dashboard/api/nova.py b/starlingx_dashboard/api/nova.py
new file mode 100644
index 00000000..11410678
--- /dev/null
+++ b/starlingx_dashboard/api/nova.py
@@ -0,0 +1,10 @@
+#
+# Copyright (c) 2018 Intel Corporation
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+from openstack_dashboard.api.nova import *
+
+def server_group_create(request, **kwargs):
+ return novaclient(request).server_groups.create(**kwargs)
\ No newline at end of file
diff --git a/cgcs_dashboard/api/patch.py b/starlingx_dashboard/api/patch.py
similarity index 97%
rename from cgcs_dashboard/api/patch.py
rename to starlingx_dashboard/api/patch.py
index bdb08561..3d90fb41 100755
--- a/cgcs_dashboard/api/patch.py
+++ b/starlingx_dashboard/api/patch.py
@@ -12,10 +12,6 @@
#
# Copyright (c) 2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
import logging
import urlparse
diff --git a/starlingx_dashboard/api/rest/__init__.py b/starlingx_dashboard/api/rest/__init__.py
new file mode 100755
index 00000000..4ec8b9da
--- /dev/null
+++ b/starlingx_dashboard/api/rest/__init__.py
@@ -0,0 +1,24 @@
+# Copyright 2014, Rackspace, US, 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.
+#
+# Copyright (c) 2014 Wind River Systems, Inc.
+#
+
+from openstack_dashboard.api.rest import dc_manager
+from openstack_dashboard.api.rest import sysinv
+
+
+__all__ = [
+ 'dc_manager',
+ 'sysinv',
+]
diff --git a/cgcs_dashboard/api/rest/dc_manager.py b/starlingx_dashboard/api/rest/dc_manager.py
similarity index 82%
rename from cgcs_dashboard/api/rest/dc_manager.py
rename to starlingx_dashboard/api/rest/dc_manager.py
index 966693c2..2f8ca721 100755
--- a/cgcs_dashboard/api/rest/dc_manager.py
+++ b/starlingx_dashboard/api/rest/dc_manager.py
@@ -1,10 +1,17 @@
+# 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.
#
# Copyright (c) 2017 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
import logging
diff --git a/cgcs_dashboard/api/rest/sysinv.py b/starlingx_dashboard/api/rest/sysinv.py
similarity index 62%
rename from cgcs_dashboard/api/rest/sysinv.py
rename to starlingx_dashboard/api/rest/sysinv.py
index 1926694e..450b4ab3 100755
--- a/cgcs_dashboard/api/rest/sysinv.py
+++ b/starlingx_dashboard/api/rest/sysinv.py
@@ -1,10 +1,18 @@
+# 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.
#
# Copyright (c) 2017 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
+
from django.views import generic
diff --git a/cgcs_dashboard/api/sysinv.py b/starlingx_dashboard/api/sysinv.py
similarity index 96%
rename from cgcs_dashboard/api/sysinv.py
rename to starlingx_dashboard/api/sysinv.py
index b462ccf4..41d51be3 100755
--- a/cgcs_dashboard/api/sysinv.py
+++ b/starlingx_dashboard/api/sysinv.py
@@ -10,14 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
#
-# Copyright (c) 2013-2017 Wind River Systems, Inc.
+# Copyright (c) 2013-2018 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
-
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
from __future__ import absolute_import
@@ -31,6 +25,7 @@ from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from openstack_dashboard.api import base
+from starlingx_dashboard.api import base as stx_base
import cgcs_patch.constants as patch_constants
import sysinv.common.constants as constants
@@ -142,7 +137,7 @@ def cgtsclient(request):
cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None)
# FIXME this returns the wrong URL
- endpoint = base.url_for(request, 'platform', 'adminURL')
+ endpoint = base.url_for(request, 'platform', 'publicURL')
version = 1
LOG.debug('cgtsclient connection created using token "%s" and url "%s"',
@@ -153,7 +148,7 @@ def cgtsclient(request):
return cgts_client.Client(version=version,
endpoint=endpoint,
auth_url=base.url_for(request, 'identity',
- 'adminURL'),
+ 'publicURL'),
token=request.user.token.id, # os_auth_token
username=request.user.username,
password=request.user.token.id,
@@ -169,9 +164,6 @@ class Memory(base.APIResourceWrapper):
'platform_reserved_mib',
'memavail_mib',
'hugepages_configured',
- 'avs_hugepages_size_mib',
- 'avs_hugepages_nr',
- 'avs_hugepages_avail',
'vm_hugepages_nr_2M_pending',
'vm_hugepages_avail_2M',
'vm_hugepages_nr_1G_pending',
@@ -288,6 +280,7 @@ class StorageVolume(base.APIResourceWrapper):
'capabilities',
'idisk_uuid',
'ihost_uuid',
+ 'tier_name',
'journal_path',
'journal_size_mib',
'journal_location']
@@ -1066,7 +1059,7 @@ def alarm_list(request, search_opts=None):
marker = search_opts.get('marker', None)
sort_key = search_opts.get('sort_key', None)
sort_dir = search_opts.get('sort_dir', None)
- page_size = base.get_request_page_size(request, limit)
+ page_size = stx_base.get_request_page_size(request, limit)
if "suppression" in search_opts:
suppression = search_opts.pop('suppression')
@@ -1400,17 +1393,94 @@ def extoam_list(request):
return [EXTOAM(n) for n in extoam]
+class Cluster(base.APIResourceWrapper):
+ """..."""
+ _attrs = ['uuid', 'cluster_uuid', 'type', 'name']
+
+ def __init__(self, apiresource):
+ super(Cluster, self).__init__(apiresource)
+
+ if hasattr(self, 'uuid'):
+ self._uuid = self.uuid
+ self._name = self.name
+ self._type = self.type
+ self._cluster_uuid = self.cluster_uuid
+ else:
+ self._uuid = None
+ self._name = None
+ self._type = None
+ self._cluster_uuid = None
+
+ @property
+ def uuid(self):
+ return self._uuid
+
+ @property
+ def name(self):
+ return self._name
+
+ @property
+ def type(self):
+ return self._type
+
+ @property
+ def cluster_uuid(self):
+ return self._cluster_uuid
+
+
+def cluster_list(request):
+ clusters = cgtsclient(request).cluster.list()
+
+ return [Cluster(n) for n in clusters]
+
+
+class StorageTier(base.APIResourceWrapper):
+ """..."""
+ _attrs = ['uuid', 'name', 'type', 'status']
+
+ def __init__(self, apiresource):
+ super(StorageTier, self).__init__(apiresource)
+
+ if hasattr(self, 'uuid'):
+ self._uuid = self.uuid
+ self._name = self.name
+ self._type = self.type
+ self._status = self.status
+ else:
+ self._uuid = None
+ self._name = None
+ self._type = None
+ self._status = None
+
+ @property
+ def uuid(self):
+ return self._uuid
+
+ @property
+ def name(self):
+ return self._name
+
+ @property
+ def type(self):
+ return self._type
+
+ @property
+ def status(self):
+ return self._status
+
+
class StorageCeph(base.APIResourceWrapper):
"""..."""
_attrs = ['cinder_pool_gib', 'glance_pool_gib', 'ephemeral_pool_gib',
- 'object_pool_gib', 'object_gateway', 'uuid', 'link',
+ 'object_pool_gib', 'object_gateway', 'uuid', 'tier_name', 'link',
'ceph_total_space_gib']
def __init__(self, apiresource):
super(StorageCeph, self).__init__(apiresource)
if hasattr(self, 'uuid'):
+ self._tier_name = self.tier_name
self._cinder_pool_gib = self.cinder_pool_gib
self._glance_pool_gib = self.glance_pool_gib
self._ephemeral_pool_gib = self.ephemeral_pool_gib
@@ -1418,6 +1488,7 @@ class StorageCeph(base.APIResourceWrapper):
self._object_gateway = self.object_gateway
self._ceph_total_space_gib = self.ceph_total_space_gib
else:
+ self._tier_name = None
self._cinder_pool_gib = None
self._glance_pool_gib = None
self._ephemeral_pool_gib = None
@@ -1425,6 +1496,10 @@ class StorageCeph(base.APIResourceWrapper):
self._object_gateway = None
self._ceph_total_space_gib = None
+ @property
+ def tier_name(self):
+ return self._tier_name
+
@property
def cinder_pool_gib(self):
return self._cinder_pool_gib
@@ -1452,12 +1527,14 @@ class StorageCeph(base.APIResourceWrapper):
class StorageBackend(base.APIResourceWrapper):
"""..."""
- _attrs = ['isystem_uuid', 'backend', 'state', 'task', 'uuid', 'link']
+ _attrs = ['isystem_uuid', 'name', 'backend',
+ 'state', 'task', 'uuid', 'link']
def __init__(self, apiresource):
super(StorageBackend, self).__init__(apiresource)
if hasattr(self, 'uuid'):
+ self._name = self.name
self._backend = self.backend
self._state = self.state
self._task = self.task
@@ -1466,6 +1543,10 @@ class StorageBackend(base.APIResourceWrapper):
self._state = None
self._task = None
+ @property
+ def name(self):
+ return self._name
+
@property
def backend(self):
return self._backend
@@ -1554,37 +1635,20 @@ class CephMon(base.APIResourceWrapper):
class STORAGE(base.APIResourceWrapper):
"""..."""
_attrs = ['isystem_uuid', 'backup_gib', 'scratch_gib', 'cgcs_gib',
- 'img_conversions_gib', 'database_gib',
- 'uuid', 'link', 'backend', 'glance_backend',
- 'cinder_pool_gib', 'glance_pool_gib', 'ephemeral_pool_gib',
- 'object_pool_gib', 'ceph_mon_gib', 'ceph_total_space_gib']
+ 'img_conversions_gib', 'database_gib', 'uuid', 'link']
- def __init__(self, controller_fs, ceph_mon, storage_ceph):
+ def __init__(self, controller_fs, ceph_mon):
if controller_fs:
super(STORAGE, self).__init__(controller_fs)
- elif storage_ceph:
- super(STORAGE, self).__init__(storage_ceph)
self._backup_gib = None
self._scratch_gib = None
self._cgcs_gib = None
self._img_conversions_gib = None
self._database_gib = None
- self._backend = None
- self._cinder_pool_gib = None
- self._glance_pool_gib = None
- self._ephemeral_pool_gib = None
self._ceph_mon_gib = None
- self._ceph_total_space_gib = None
if hasattr(self, 'uuid'):
- if storage_ceph:
- self._glance_pool_gib = storage_ceph.glance_pool_gib
- self._ephemeral_pool_gib = storage_ceph.ephemeral_pool_gib
- self._cinder_pool_gib = storage_ceph.cinder_pool_gib
- self._object_pool_gib = storage_ceph.object_pool_gib
- self._ceph_total_space_gib = storage_ceph.ceph_total_space_gib
-
if controller_fs:
self._backup_gib = controller_fs.backup_gib
self._scratch_gib = controller_fs.scratch_gib
@@ -1617,34 +1681,10 @@ class STORAGE(base.APIResourceWrapper):
def img_conversions_gib(self):
return self._img_conversions_gib
- @property
- def backend(self):
- return self._backend
-
- @property
- def glance_backend(self):
- return self._glance_backend
-
- @property
- def cinder_pool_gib(self):
- return self._cinder_pool_gib
-
- @property
- def glance_pool_gib(self):
- return self._glance_pool_gib
-
- @property
- def ephemeral_pool_gib(self):
- return self._ephemeral_pool_gib
-
@property
def ceph_mon_gib(self):
return self._ceph_mon_gib
- @property
- def ceph_total_space_gib(self):
- return self._ceph_total_space_gib
-
def storfs_update(request, controller_fs_id, **kwargs):
LOG.info("Updating controller fs storage with kwargs=%s", kwargs)
@@ -1752,7 +1792,7 @@ def storagefs_list(request):
if ceph_mon_list:
ceph_mon_obj = ceph_mon_list[0]
- return [STORAGE(controllerfs_obj, ceph_mon_obj, None)]
+ return [STORAGE(controllerfs_obj, ceph_mon_obj)]
def controllerfs_list(request):
@@ -1765,6 +1805,12 @@ def controllerfs_list(request):
return [ControllerFS(n) for n in controllerfs]
+def storage_tier_list(request, cluster_id):
+ storage_tiers = cgtsclient(request).storage_tier.list(cluster_id)
+
+ return [StorageTier(n) for n in storage_tiers]
+
+
def storage_backend_list(request):
backends = cgtsclient(request).storage_backend.list()
@@ -1982,8 +2028,7 @@ def host_interface_delete(request, interface_id):
class Address(base.APIResourceWrapper):
"""Wrapper for Inventory Addresses"""
- _attrs = ['uuid', 'interface_uuid', 'networktype', 'address', 'prefix',
- 'enable_dad']
+ _attrs = ['uuid', 'interface_uuid', 'address', 'prefix', 'enable_dad']
def __init__(self, apiresource):
super(Address, self).__init__(apiresource)
@@ -2317,7 +2362,7 @@ def event_log_list(request, search_opts=None):
limit = search_opts.get('limit', None)
marker = search_opts.get('marker', None)
- page_size = base.get_request_page_size(request, limit)
+ page_size = stx_base.get_request_page_size(request, limit)
if 'paginate' in search_opts:
paginate = search_opts.pop('paginate')
diff --git a/cgcs_dashboard/api/vim.py b/starlingx_dashboard/api/vim.py
similarity index 88%
rename from cgcs_dashboard/api/vim.py
rename to starlingx_dashboard/api/vim.py
index 8e136fa9..dd14f8a4 100755
--- a/cgcs_dashboard/api/vim.py
+++ b/starlingx_dashboard/api/vim.py
@@ -1,10 +1,17 @@
+# 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.
#
# Copyright (c) 2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
import logging
import urlparse
diff --git a/cgcs_dashboard/dashboards/__init__.py b/starlingx_dashboard/dashboards/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/__init__.py
rename to starlingx_dashboard/dashboards/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/__init__.py b/starlingx_dashboard/dashboards/admin/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/__init__.py
rename to starlingx_dashboard/dashboards/admin/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/fault_management/__init__.py b/starlingx_dashboard/dashboards/admin/fault_management/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/fault_management/__init__.py
rename to starlingx_dashboard/dashboards/admin/fault_management/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/fault_management/panel.py b/starlingx_dashboard/dashboards/admin/fault_management/panel.py
similarity index 88%
rename from cgcs_dashboard/dashboards/admin/fault_management/panel.py
rename to starlingx_dashboard/dashboards/admin/fault_management/panel.py
index da127cee..ada7b052 100755
--- a/cgcs_dashboard/dashboards/admin/fault_management/panel.py
+++ b/starlingx_dashboard/dashboards/admin/fault_management/panel.py
@@ -18,9 +18,6 @@
#
# Copyright (c) 2013-2017 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
from django.utils.translation import ugettext_lazy as _ # noqa
@@ -35,12 +32,16 @@ class FaultManagement(horizon.Panel):
permissions = ('openstack.services.platform',)
def allowed(self, context):
+ if context['request'].user.services_region == 'SystemController':
+ return False
if not base.is_service_enabled(context['request'], 'platform'):
return False
else:
return super(FaultManagement, self).allowed(context)
def nav(self, context):
+ if context['request'].user.services_region == 'SystemController':
+ return False
if not base.is_service_enabled(context['request'], 'platform'):
return False
else:
diff --git a/cgcs_dashboard/dashboards/admin/fault_management/tables.py b/starlingx_dashboard/dashboards/admin/fault_management/tables.py
similarity index 86%
rename from cgcs_dashboard/dashboards/admin/fault_management/tables.py
rename to starlingx_dashboard/dashboards/admin/fault_management/tables.py
index 17c62866..7af6f667 100755
--- a/cgcs_dashboard/dashboards/admin/fault_management/tables.py
+++ b/starlingx_dashboard/dashboards/admin/fault_management/tables.py
@@ -18,9 +18,6 @@
#
# Copyright (c) 2013-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
from django.utils.html import escape as escape_html
@@ -32,9 +29,10 @@ from django.utils.translation import ungettext_lazy
from horizon import exceptions
from horizon import tables
+from starlingx_dashboard.horizon import tables as stx_tables
from horizon.utils import filters as utils_filters
from openstack_dashboard import api
-from openstack_dashboard.api import sysinv
+from starlingx_dashboard import api as stx_api
SUPPRESSION_STATUS_CHOICES = (
("suppressed", False),
@@ -50,21 +48,21 @@ SUPPRESSION_STATUS_DISPLAY_CHOICES = (
)
-class AlarmsLimitAction(tables.LimitAction):
+class AlarmsLimitAction(stx_tables.LimitAction):
verbose_name = _("Alarms")
-class AlarmFilterAction(tables.FixedWithQueryFilter):
+class AlarmFilterAction(stx_tables.FixedWithQueryFilter):
def __init__(self, **kwargs):
super(AlarmFilterAction, self).__init__(**kwargs)
self.filter_choices = [
(
- (sysinv.FM_SUPPRESS_SHOW, _("Show Suppressed"), True),
- (sysinv.FM_SUPPRESS_HIDE, _('Hide Suppressed'), True)
+ (stx_api.sysinv.FM_SUPPRESS_SHOW, _("Show Suppressed"), True),
+ (stx_api.sysinv.FM_SUPPRESS_HIDE, _('Hide Suppressed'), True)
)
]
- self.default_value = sysinv.FM_SUPPRESS_HIDE
+ self.default_value = stx_api.sysinv.FM_SUPPRESS_HIDE
self.disabled_choices = ['enabled']
@@ -105,26 +103,26 @@ class AlarmsTable(tables.DataTable):
hidden_title = False
-class EventLogsLimitAction(tables.LimitAction):
+class EventLogsLimitAction(stx_tables.LimitAction):
verbose_name = _("Events")
-class EventLogsFilterAction(tables.FixedWithQueryFilter):
+class EventLogsFilterAction(stx_tables.FixedWithQueryFilter):
def __init__(self, **kwargs):
super(EventLogsFilterAction, self).__init__(**kwargs)
self.filter_choices = [
(
- (sysinv.FM_ALL, _("All Events"), True),
- (sysinv.FM_ALARM, _('Alarm Events'), True),
- (sysinv.FM_LOG, _('Log Events'), True),
+ (stx_api.sysinv.FM_ALL, _("All Events"), True),
+ (stx_api.sysinv.FM_ALARM, _('Alarm Events'), True),
+ (stx_api.sysinv.FM_LOG, _('Log Events'), True),
),
(
- (sysinv.FM_SUPPRESS_SHOW, _("Show Suppressed"), True),
- (sysinv.FM_SUPPRESS_HIDE, _('Hide Suppressed'), True)
+ (stx_api.sysinv.FM_SUPPRESS_SHOW, _("Show Suppressed"), True),
+ (stx_api.sysinv.FM_SUPPRESS_HIDE, _('Hide Suppressed'), True)
)
]
- self.default_value = sysinv.FM_ALL_SUPPRESS_HIDE
+ self.default_value = stx_api.sysinv.FM_ALL_SUPPRESS_HIDE
self.disabled_choices = ['enabled', 'enabled']
@@ -190,16 +188,16 @@ class SuppressEvent(tables.BatchAction):
def allowed(self, request, datum):
"""Allow suppress action if Alarm ID is unsuppressed."""
- if datum.suppression_status == sysinv.FM_SUPPRESSED:
+ if datum.suppression_status == stx_api.sysinv.FM_SUPPRESSED:
return False
return True
def action(self, request, obj_id):
- kwargs = {"suppression_status": sysinv.FM_SUPPRESSED}
+ kwargs = {"suppression_status": stx_api.sysinv.FM_SUPPRESSED}
try:
- api.sysinv.event_suppression_update(request, obj_id, **kwargs)
+ stx_api.sysinv.event_suppression_update(request, obj_id, **kwargs)
except Exception:
exceptions.handle(request,
_('Unable to set specified alarm type to \
@@ -230,16 +228,16 @@ class UnsuppressEvent(tables.BatchAction):
def allowed(self, request, datum):
"""Allow unsuppress action if Alarm ID is suppressed."""
- if datum.suppression_status == sysinv.FM_UNSUPPRESSED:
+ if datum.suppression_status == stx_api.sysinv.FM_UNSUPPRESSED:
return False
return True
def action(self, request, obj_id):
- kwargs = {"suppression_status": sysinv.FM_UNSUPPRESSED}
+ kwargs = {"suppression_status": stx_api.sysinv.FM_UNSUPPRESSED}
try:
- api.sysinv.event_suppression_update(request, obj_id, **kwargs)
+ stx_api.sysinv.event_suppression_update(request, obj_id, **kwargs)
except Exception:
exceptions.handle(request,
_('Unable to set specified alarm type to \
diff --git a/cgcs_dashboard/dashboards/admin/fault_management/tabs.py b/starlingx_dashboard/dashboards/admin/fault_management/tabs.py
similarity index 88%
rename from cgcs_dashboard/dashboards/admin/fault_management/tabs.py
rename to starlingx_dashboard/dashboards/admin/fault_management/tabs.py
index 56d652de..6ae0d766 100755
--- a/cgcs_dashboard/dashboards/admin/fault_management/tabs.py
+++ b/starlingx_dashboard/dashboards/admin/fault_management/tabs.py
@@ -18,9 +18,6 @@
#
# Copyright (c) 2013-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
from django.utils.translation import ugettext_lazy as _ # noqa
@@ -28,8 +25,8 @@ from django.utils.translation import ugettext_lazy as _ # noqa
from horizon import exceptions
from horizon import tabs
from openstack_dashboard import api
-from openstack_dashboard.api import sysinv
-from openstack_dashboard.dashboards.admin.fault_management import tables
+from starlingx_dashboard import api as stx_api
+from starlingx_dashboard.dashboards.admin.fault_management import tables
ALARMS_SUPPRESSION_FILTER_GROUP = 0
EVENT_SUPPRESSION_FILTER_GROUP = 1
@@ -61,7 +58,7 @@ class ActiveAlarmsTab(tabs.TableTab):
def get_context_data(self, request):
context = super(ActiveAlarmsTab, self).get_context_data(request)
- summary = api.sysinv.alarm_summary_get(
+ summary = stx_api.sysinv.alarm_summary_get(
self.request, include_suppress=False)
context["total"] = summary.critical + summary.major + summary.minor \
+ summary.warnings
@@ -86,7 +83,7 @@ class ActiveAlarmsTab(tabs.TableTab):
self.set_suppression_filter('disabled')
alarms_table.columns["suppression_status"]\
.classes.append('hidden')
- elif suppress_filter_state == sysinv.FM_SUPPRESS_HIDE:
+ elif suppress_filter_state == stx_api.sysinv.FM_SUPPRESS_HIDE:
self.set_suppression_filter('enabled')
alarms_table.columns["suppression_status"].classes\
.append('hidden')
@@ -95,7 +92,7 @@ class ActiveAlarmsTab(tabs.TableTab):
self.set_suppression_filter('disabled')
else:
self.set_suppression_filter('enabled')
- if suppress_filter_state == sysinv.FM_SUPPRESS_SHOW:
+ if suppress_filter_state == stx_api.sysinv.FM_SUPPRESS_SHOW:
alarms_table.columns["suppression_status"].classes\
.remove('hidden')
@@ -117,18 +114,16 @@ class ActiveAlarmsTab(tabs.TableTab):
def get_alarms_data(self):
search_opts = {}
-
# get retrieve parameters from request/session env
- marker = \
- self.request.GET.get(tables.AlarmsTable._meta.pagination_param,
- None)
- limit = \
- self.request.GET.get(tables.AlarmsTable._meta.limit_param,
- None)
+ #marker = \
+ # self.request.GET.get(tables.AlarmsTable._meta.pagination_param,
+ # None)
+ #limit = \
+ # self.request.GET.get(tables.AlarmsTable._meta.limit_param,
+ # None)
search_opts = self.get_filters()
- search_opts.update({'marker': marker,
- 'limit': limit,
+ search_opts.update({
'paginate': True,
'sort_key': 'severity,entity_instance_id',
'sort_dir': 'asc'})
@@ -136,10 +131,10 @@ class ActiveAlarmsTab(tabs.TableTab):
alarms = []
try:
if 'paginate' in search_opts:
- alarms, self._more = api.sysinv.alarm_list(
+ alarms, self._more = stx_api.sysinv.alarm_list(
self.request, search_opts=search_opts)
else:
- alarms = api.sysinv.alarm_list(
+ alarms = stx_api.sysinv.alarm_list(
self.request, search_opts=search_opts)
self._limit = limit
except Exception:
@@ -155,7 +150,7 @@ class ActiveAlarmsTab(tabs.TableTab):
try:
if 'suppression_list' not in self.tab_group.kwargs:
self.tab_group.kwargs['suppression_list'] = \
- api.sysinv.event_suppression_list(self.request)
+ stx_api.sysinv.event_suppression_list(self.request)
event_types = self.tab_group.kwargs['suppression_list']
except Exception:
exceptions.handle(self.request,
@@ -212,7 +207,7 @@ class EventLogTab(tabs.TableTab):
self.set_suppression_filter('disabled')
event_log_table.columns["suppression_status"]\
.classes.append('hidden')
- elif suppress_filter_state == sysinv.FM_SUPPRESS_HIDE:
+ elif suppress_filter_state == stx_api.sysinv.FM_SUPPRESS_HIDE:
self.set_suppression_filter('enabled')
event_log_table.columns["suppression_status"].\
classes.append('hidden')
@@ -221,7 +216,7 @@ class EventLogTab(tabs.TableTab):
self.set_suppression_filter('disabled')
else:
self.set_suppression_filter('enabled')
- if suppress_filter_state == sysinv.FM_SUPPRESS_SHOW:
+ if suppress_filter_state == stx_api.sysinv.FM_SUPPRESS_SHOW:
event_log_table.columns["suppression_status"]\
.classes.remove('hidden')
@@ -258,7 +253,7 @@ class EventLogTab(tabs.TableTab):
try:
# now retrieve data from rest API
events, self._more = \
- api.sysinv.event_log_list(self.request,
+ stx_api.sysinv.event_log_list(self.request,
search_opts=search_opts)
self._limit = limit
return events
@@ -278,7 +273,7 @@ class EventLogTab(tabs.TableTab):
try:
if 'suppression_list' not in self.tab_group.kwargs:
self.tab_group.kwargs['suppression_list'] = \
- api.sysinv.event_suppression_list(self.request)
+ stx_api.sysinv.event_suppression_list(self.request)
event_types = self.tab_group.kwargs['suppression_list']
except Exception:
exceptions.handle(self.request,
@@ -300,7 +295,7 @@ class EventsSuppressionTab(tabs.TableTab):
try:
if 'suppression_list' not in self.tab_group.kwargs:
self.tab_group.kwargs['suppression_list'] = \
- api.sysinv.event_suppression_list(self.request)
+ stx_api.sysinv.event_suppression_list(self.request)
event_suppression_list = self.tab_group.kwargs['suppression_list']
except Exception:
exceptions.handle(self.request,
diff --git a/cgcs_dashboard/dashboards/admin/fault_management/templates/fault_management/_active_alarms.html b/starlingx_dashboard/dashboards/admin/fault_management/templates/fault_management/_active_alarms.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/fault_management/templates/fault_management/_active_alarms.html
rename to starlingx_dashboard/dashboards/admin/fault_management/templates/fault_management/_active_alarms.html
diff --git a/cgcs_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_history.html b/starlingx_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_history.html
similarity index 97%
rename from cgcs_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_history.html
rename to starlingx_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_history.html
index 2a328fd6..65ee0861 100755
--- a/cgcs_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_history.html
+++ b/starlingx_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_history.html
@@ -1,58 +1,58 @@
-{% extends 'base.html' %}
-{% load i18n breadcrumb_nav %}
-{% block title %}{% trans "Historical Alarm Details" %}{% endblock %}
-
-{% block main %}
-{% if history.event_log_id == '' or history.event_log_id == ' ' %}
-
+ {% if history.event_log_id != '' and history.event_log_id != ' ' %}
+
{% trans "Alarm ID" %}
+
{{ history.event_log_id }}
+ {% endif %}
+
{% trans "Severity" %}
+
{{ history.severity }}
+
{% trans "Alarm State" %}
+
{{ history.state }}
+
{% trans "Alarm Type" %}
+
{{ history.event_log_type }}
+
{% trans "Timestamp" %}
+
{{ history.timestamp|parse_isotime }}
+
{% trans "Suppression" %}
+
{{ history.suppression }}
+
+
+
{% trans "Entity Instance ID" %}
+
{{ history.entity_instance_id }}
+ {% if history.entity_type_id != '' and history.entity_type_id != ' ' %}
+
{% trans "Entity Type ID" %}
+
{{ history.entity_type_id }}
+ {% endif %}
+
{% trans "Probable Cause" %}
+
{{ history.probable_cause }}
+ {% if history.proposed_repair_action != '' and history.proposed_repair_action != ' ' %}
+
{% trans "Proposed Repair Action" %}
+
{{ history.proposed_repair_action }}
+ {% endif %}
+
{% trans "Service Affecting" %}
+
{{ history.service_affecting }}
+ {% if history.reason_text != '' and history.reason_text != ' ' %}
+
{% trans "Reason" %}
+
{{ history.reason_text }}
+ {% endif %}
+
+
+
+
+{% endblock %}
diff --git a/cgcs_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_log.html b/starlingx_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_log.html
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_log.html
rename to starlingx_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_log.html
index 4ea38e19..19cfb0dc 100755
--- a/cgcs_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_log.html
+++ b/starlingx_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_log.html
@@ -1,50 +1,50 @@
-{% extends 'base.html' %}
-{% load i18n breadcrumb_nav %}
-{% block title %}{% trans "Customer Log Details" %}{% endblock %}
-
-{% block main %}
-{% if log.event_log_id == '' or log.event_log_id == ' ' %}
-
{{log.reason_text }}
-{% else %}
-
{{log.event_log_id }} - {{log.reason_text }}
-{% endif %}
-
-
-
-
-
{% trans "Info" %}
-
-
-
{% trans "Log UUID" %}
-
{{ log.uuid }}
- {% if log.event_log_id != '' and log.event_log_id != ' ' %}
-
{% trans "Log ID" %}
-
{{ log.event_log_id }}
- {% endif %}
-
{% trans "Severity" %}
-
{{ log.severity }}
-
{% trans "Log Type" %}
-
{{ log.event_log_type }}
-
{% trans "Timestamp" %}
-
{{ log.timestamp|parse_isotime }}
-
-
-
{% trans "Entity Instance ID" %}
-
{{ log.entity_instance_id }}
- {% if log.entity_type_id != '' and log.entity_type_id != ' ' %}
-
{% trans "Entity Type ID" %}
-
{{ log.entity_type_id }}
- {% endif %}
-
{% trans "Probable Cause" %}
-
{{ log.probable_cause }}
-
{% trans "Service Affecting" %}
-
{{ log.service_affecting }}
- {% if log.reason_text != '' and log.reason_text != ' ' %}
-
{% trans "Reason" %}
-
{{ log.reason_text }}
- {% endif %}
-
-
-
-
-{% endblock %}
+{% extends 'base.html' %}
+{% load i18n breadcrumb_nav %}
+{% block title %}{% trans "Customer Log Details" %}{% endblock %}
+
+{% block main %}
+{% if log.event_log_id == '' or log.event_log_id == ' ' %}
+
{{log.reason_text }}
+{% else %}
+
{{log.event_log_id }} - {{log.reason_text }}
+{% endif %}
+
+
+
+
+
{% trans "Info" %}
+
+
+
{% trans "Log UUID" %}
+
{{ log.uuid }}
+ {% if log.event_log_id != '' and log.event_log_id != ' ' %}
+
{% trans "Log ID" %}
+
{{ log.event_log_id }}
+ {% endif %}
+
{% trans "Severity" %}
+
{{ log.severity }}
+
{% trans "Log Type" %}
+
{{ log.event_log_type }}
+
{% trans "Timestamp" %}
+
{{ log.timestamp|parse_isotime }}
+
+
+
{% trans "Entity Instance ID" %}
+
{{ log.entity_instance_id }}
+ {% if log.entity_type_id != '' and log.entity_type_id != ' ' %}
+
{% trans "Entity Type ID" %}
+
{{ log.entity_type_id }}
+ {% endif %}
+
{% trans "Probable Cause" %}
+
{{ log.probable_cause }}
+
{% trans "Service Affecting" %}
+
{{ log.service_affecting }}
+ {% if log.reason_text != '' and log.reason_text != ' ' %}
+
{% trans "Reason" %}
+
{{ log.reason_text }}
+ {% endif %}
+
+
+
+
+{% endblock %}
diff --git a/cgcs_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_overview.html b/starlingx_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_overview.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_overview.html
rename to starlingx_dashboard/dashboards/admin/fault_management/templates/fault_management/_detail_overview.html
diff --git a/cgcs_dashboard/dashboards/admin/fault_management/templates/fault_management/_summary.html b/starlingx_dashboard/dashboards/admin/fault_management/templates/fault_management/_summary.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/fault_management/templates/fault_management/_summary.html
rename to starlingx_dashboard/dashboards/admin/fault_management/templates/fault_management/_summary.html
diff --git a/cgcs_dashboard/dashboards/admin/fault_management/templates/fault_management/index.html b/starlingx_dashboard/dashboards/admin/fault_management/templates/fault_management/index.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/fault_management/templates/fault_management/index.html
rename to starlingx_dashboard/dashboards/admin/fault_management/templates/fault_management/index.html
diff --git a/cgcs_dashboard/dashboards/admin/fault_management/urls.py b/starlingx_dashboard/dashboards/admin/fault_management/urls.py
similarity index 83%
rename from cgcs_dashboard/dashboards/admin/fault_management/urls.py
rename to starlingx_dashboard/dashboards/admin/fault_management/urls.py
index d3d9f98e..76d8e1e9 100755
--- a/cgcs_dashboard/dashboards/admin/fault_management/urls.py
+++ b/starlingx_dashboard/dashboards/admin/fault_management/urls.py
@@ -18,14 +18,11 @@
#
# Copyright (c) 2013-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
from django.conf.urls import url # noqa
-from openstack_dashboard.dashboards.admin.fault_management import views
+from starlingx_dashboard.dashboards.admin.fault_management import views
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
diff --git a/cgcs_dashboard/dashboards/admin/fault_management/views.py b/starlingx_dashboard/dashboards/admin/fault_management/views.py
similarity index 91%
rename from cgcs_dashboard/dashboards/admin/fault_management/views.py
rename to starlingx_dashboard/dashboards/admin/fault_management/views.py
index d4219694..a0ba5d6e 100755
--- a/cgcs_dashboard/dashboards/admin/fault_management/views.py
+++ b/starlingx_dashboard/dashboards/admin/fault_management/views.py
@@ -18,9 +18,6 @@
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
import logging
@@ -32,8 +29,9 @@ from django.views.generic import TemplateView
from horizon import exceptions
from horizon import tabs
from horizon import views
-from openstack_dashboard import api
-from openstack_dashboard.dashboards.admin.fault_management import \
+from openstack_dashboard.api.base import is_service_enabled
+from starlingx_dashboard import api as stx_api
+from starlingx_dashboard.dashboards.admin.fault_management import \
tabs as project_tabs
LOG = logging.getLogger(__name__)
@@ -58,7 +56,7 @@ class DetailView(views.HorizonTemplateView):
if not hasattr(self, "_alarm"):
alarm_uuid = self.kwargs['id']
try:
- alarm = api.sysinv.alarm_get(self.request, alarm_uuid)
+ alarm = stx_api.sysinv.alarm_get(self.request, alarm_uuid)
except Exception:
redirect = reverse('horizon:admin:fault_management:index')
@@ -120,7 +118,7 @@ class EventLogDetailView(views.HorizonTemplateView):
if not hasattr(self, "_eventlog"):
uuid = self.kwargs['id']
try:
- self._eventlog = api.sysinv.event_log_get(self.request, uuid)
+ self._eventlog = stx_api.sysinv.event_log_get(self.request, uuid)
self._detectEventLogType()
except Exception:
redirect = reverse('horizon:admin:fault_management:index')
@@ -157,7 +155,7 @@ class BannerView(TemplateView):
[s for s in summaries if s.status == 'critical'])
context["disabled"] = len(
[s for s in summaries if s.status == 'disabled'])
- elif api.base.is_TiS_region(self.request):
+ elif is_service_enabled(self.request, 'platform'):
context["summary"] = self.get_data()
context["alarmbanner"] = True
return context
@@ -165,11 +163,11 @@ class BannerView(TemplateView):
def get_data(self):
summary = None
try:
- summary = api.sysinv.alarm_summary_get(self.request)
+ summary = stx_api.sysinv.alarm_summary_get(self.request)
except Exception:
exceptions.handle(self.request,
_('Unable to retrieve alarm summary.'))
return summary
def get_subcloud_data(self):
- return api.dc_manager.alarm_summary_list(self.request)
+ return stx_api.dc_manager.alarm_summary_list(self.request)
diff --git a/cgcs_dashboard/dashboards/admin/host_topology/__init__.py b/starlingx_dashboard/dashboards/admin/host_topology/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/host_topology/__init__.py
rename to starlingx_dashboard/dashboards/admin/host_topology/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/host_topology/panel.py b/starlingx_dashboard/dashboards/admin/host_topology/panel.py
similarity index 70%
rename from cgcs_dashboard/dashboards/admin/host_topology/panel.py
rename to starlingx_dashboard/dashboards/admin/host_topology/panel.py
index abfb43a7..8d32f98e 100755
--- a/cgcs_dashboard/dashboards/admin/host_topology/panel.py
+++ b/starlingx_dashboard/dashboards/admin/host_topology/panel.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
@@ -17,15 +15,19 @@ from openstack_dashboard.dashboards.admin import dashboard
class HostTopology(horizon.Panel):
name = _("Provider Network Topology")
slug = 'host_topology'
- permissions = ('openstack.services.platform',)
+ permissions = ('openstack.services.platform', 'openstack.services.network')
def allowed(self, context):
+ if context['request'].user.services_region == 'SystemController':
+ return False
if not base.is_service_enabled(context['request'], 'platform'):
return False
else:
return super(HostTopology, self).allowed(context)
def nav(self, context):
+ if context['request'].user.services_region == 'SystemController':
+ return False
if not base.is_service_enabled(context['request'], 'platform'):
return False
else:
diff --git a/cgcs_dashboard/dashboards/admin/host_topology/tables.py b/starlingx_dashboard/dashboards/admin/host_topology/tables.py
similarity index 86%
rename from cgcs_dashboard/dashboards/admin/host_topology/tables.py
rename to starlingx_dashboard/dashboards/admin/host_topology/tables.py
index a8523008..e6a28c12 100755
--- a/cgcs_dashboard/dashboards/admin/host_topology/tables.py
+++ b/starlingx_dashboard/dashboards/admin/host_topology/tables.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/host_topology/tabs.py b/starlingx_dashboard/dashboards/admin/host_topology/tabs.py
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/host_topology/tabs.py
rename to starlingx_dashboard/dashboards/admin/host_topology/tabs.py
index b7438e0a..9373a30f 100755
--- a/cgcs_dashboard/dashboards/admin/host_topology/tabs.py
+++ b/starlingx_dashboard/dashboards/admin/host_topology/tabs.py
@@ -1,8 +1,6 @@
# Copyright (c) 2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
diff --git a/cgcs_dashboard/dashboards/admin/host_topology/templates/host_topology/_svg_element.html b/starlingx_dashboard/dashboards/admin/host_topology/templates/host_topology/_svg_element.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/host_topology/templates/host_topology/_svg_element.html
rename to starlingx_dashboard/dashboards/admin/host_topology/templates/host_topology/_svg_element.html
diff --git a/cgcs_dashboard/dashboards/admin/host_topology/templates/host_topology/detail/_detail_alarms.html b/starlingx_dashboard/dashboards/admin/host_topology/templates/host_topology/detail/_detail_alarms.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/host_topology/templates/host_topology/detail/_detail_alarms.html
rename to starlingx_dashboard/dashboards/admin/host_topology/templates/host_topology/detail/_detail_alarms.html
diff --git a/cgcs_dashboard/dashboards/admin/host_topology/templates/host_topology/detail/providernet.html b/starlingx_dashboard/dashboards/admin/host_topology/templates/host_topology/detail/providernet.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/host_topology/templates/host_topology/detail/providernet.html
rename to starlingx_dashboard/dashboards/admin/host_topology/templates/host_topology/detail/providernet.html
diff --git a/cgcs_dashboard/dashboards/admin/host_topology/templates/host_topology/detail/tabbed_detail.html b/starlingx_dashboard/dashboards/admin/host_topology/templates/host_topology/detail/tabbed_detail.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/host_topology/templates/host_topology/detail/tabbed_detail.html
rename to starlingx_dashboard/dashboards/admin/host_topology/templates/host_topology/detail/tabbed_detail.html
diff --git a/cgcs_dashboard/dashboards/admin/host_topology/templates/host_topology/index.html b/starlingx_dashboard/dashboards/admin/host_topology/templates/host_topology/index.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/host_topology/templates/host_topology/index.html
rename to starlingx_dashboard/dashboards/admin/host_topology/templates/host_topology/index.html
diff --git a/cgcs_dashboard/dashboards/admin/host_topology/urls.py b/starlingx_dashboard/dashboards/admin/host_topology/urls.py
similarity index 74%
rename from cgcs_dashboard/dashboards/admin/host_topology/urls.py
rename to starlingx_dashboard/dashboards/admin/host_topology/urls.py
index abd05a54..250d6baa 100755
--- a/cgcs_dashboard/dashboards/admin/host_topology/urls.py
+++ b/starlingx_dashboard/dashboards/admin/host_topology/urls.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
diff --git a/cgcs_dashboard/dashboards/admin/host_topology/views.py b/starlingx_dashboard/dashboards/admin/host_topology/views.py
similarity index 97%
rename from cgcs_dashboard/dashboards/admin/host_topology/views.py
rename to starlingx_dashboard/dashboards/admin/host_topology/views.py
index e5959cd4..04d8a80b 100755
--- a/cgcs_dashboard/dashboards/admin/host_topology/views.py
+++ b/starlingx_dashboard/dashboards/admin/host_topology/views.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
diff --git a/cgcs_dashboard/dashboards/admin/inventory/__init__.py b/starlingx_dashboard/dashboards/admin/inventory/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/__init__.py
rename to starlingx_dashboard/dashboards/admin/inventory/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/cpu_functions/__init__.py b/starlingx_dashboard/dashboards/admin/inventory/cpu_functions/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/cpu_functions/__init__.py
rename to starlingx_dashboard/dashboards/admin/inventory/cpu_functions/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/cpu_functions/forms.py b/starlingx_dashboard/dashboards/admin/inventory/cpu_functions/forms.py
similarity index 98%
rename from cgcs_dashboard/dashboards/admin/inventory/cpu_functions/forms.py
rename to starlingx_dashboard/dashboards/admin/inventory/cpu_functions/forms.py
index 3b18aef1..ba215e5c 100644
--- a/cgcs_dashboard/dashboards/admin/inventory/cpu_functions/forms.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/cpu_functions/forms.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/cpu_functions/tables.py b/starlingx_dashboard/dashboards/admin/inventory/cpu_functions/tables.py
similarity index 93%
rename from cgcs_dashboard/dashboards/admin/inventory/cpu_functions/tables.py
rename to starlingx_dashboard/dashboards/admin/inventory/cpu_functions/tables.py
index 71b3deca..7f2d4e5d 100644
--- a/cgcs_dashboard/dashboards/admin/inventory/cpu_functions/tables.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/cpu_functions/tables.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/inventory/cpu_functions/utils.py b/starlingx_dashboard/dashboards/admin/inventory/cpu_functions/utils.py
similarity index 97%
rename from cgcs_dashboard/dashboards/admin/inventory/cpu_functions/utils.py
rename to starlingx_dashboard/dashboards/admin/inventory/cpu_functions/utils.py
index 40625432..510e8e73 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/cpu_functions/utils.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/cpu_functions/utils.py
@@ -1,9 +1,8 @@
#
# Copyright (c) 2013-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
+#
from django.utils.translation import ugettext_lazy as _
diff --git a/cgcs_dashboard/dashboards/admin/inventory/cpu_functions/views.py b/starlingx_dashboard/dashboards/admin/inventory/cpu_functions/views.py
similarity index 97%
rename from cgcs_dashboard/dashboards/admin/inventory/cpu_functions/views.py
rename to starlingx_dashboard/dashboards/admin/inventory/cpu_functions/views.py
index ead04e6a..4bcad4c9 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/cpu_functions/views.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/cpu_functions/views.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/devices/__init__.py b/starlingx_dashboard/dashboards/admin/inventory/devices/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/devices/__init__.py
rename to starlingx_dashboard/dashboards/admin/inventory/devices/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/devices/forms.py b/starlingx_dashboard/dashboards/admin/inventory/devices/forms.py
similarity index 93%
rename from cgcs_dashboard/dashboards/admin/inventory/devices/forms.py
rename to starlingx_dashboard/dashboards/admin/inventory/devices/forms.py
index a2da6267..bd723a87 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/devices/forms.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/devices/forms.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2014-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/devices/tables.py b/starlingx_dashboard/dashboards/admin/inventory/devices/tables.py
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/inventory/devices/tables.py
rename to starlingx_dashboard/dashboards/admin/inventory/devices/tables.py
index 173ca30b..58698640 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/devices/tables.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/devices/tables.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2014-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/devices/views.py b/starlingx_dashboard/dashboards/admin/inventory/devices/views.py
similarity index 97%
rename from cgcs_dashboard/dashboards/admin/inventory/devices/views.py
rename to starlingx_dashboard/dashboards/admin/inventory/devices/views.py
index b0aa45ca..022be791 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/devices/views.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/devices/views.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2014-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/interfaces/__init__.py b/starlingx_dashboard/dashboards/admin/inventory/interfaces/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/interfaces/__init__.py
rename to starlingx_dashboard/dashboards/admin/inventory/interfaces/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/interfaces/address/__init__.py b/starlingx_dashboard/dashboards/admin/inventory/interfaces/address/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/interfaces/address/__init__.py
rename to starlingx_dashboard/dashboards/admin/inventory/interfaces/address/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/interfaces/address/forms.py b/starlingx_dashboard/dashboards/admin/inventory/interfaces/address/forms.py
similarity index 93%
rename from cgcs_dashboard/dashboards/admin/inventory/interfaces/address/forms.py
rename to starlingx_dashboard/dashboards/admin/inventory/interfaces/address/forms.py
index 690ecee3..8de0d0d6 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/interfaces/address/forms.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/interfaces/address/forms.py
@@ -14,10 +14,6 @@
#
# Copyright (c) 2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/inventory/interfaces/address/tables.py b/starlingx_dashboard/dashboards/admin/inventory/interfaces/address/tables.py
similarity index 92%
rename from cgcs_dashboard/dashboards/admin/inventory/interfaces/address/tables.py
rename to starlingx_dashboard/dashboards/admin/inventory/interfaces/address/tables.py
index 0c8d2df2..973bc24d 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/interfaces/address/tables.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/interfaces/address/tables.py
@@ -1,4 +1,4 @@
-# Copyright 2015 Wind River Systems, Inc
+# Copyright 2015-2018 Wind River Systems, 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
@@ -71,14 +71,16 @@ class CreateAddress(tables.LinkAction):
def allowed(self, request, datum=None):
interface = self.table.get_interface()
- supported = interface.networktype.split(',')
if not interface:
return False
- if any(t in supported for t in ALLOWED_INTERFACE_TYPES):
+
+ if interface.networktype:
+ supported = interface.networktype.split(',')
+ if any(t in supported for t in ALLOWED_INTERFACE_TYPES):
+ return True
+ if getattr(interface, 'ipv4_mode', '') == 'static':
return True
- if interface.ipv4_mode in ['static']:
- return True
- if interface.ipv6_mode in ['static']:
+ if getattr(interface, 'ipv6_mode', '') == 'static':
return True
return False
diff --git a/cgcs_dashboard/dashboards/admin/inventory/interfaces/address/views.py b/starlingx_dashboard/dashboards/admin/inventory/interfaces/address/views.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/interfaces/address/views.py
rename to starlingx_dashboard/dashboards/admin/inventory/interfaces/address/views.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/interfaces/forms.py b/starlingx_dashboard/dashboards/admin/inventory/interfaces/forms.py
similarity index 99%
rename from cgcs_dashboard/dashboards/admin/inventory/interfaces/forms.py
rename to starlingx_dashboard/dashboards/admin/inventory/interfaces/forms.py
index 525832da..4dbca9d1 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/interfaces/forms.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/interfaces/forms.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/interfaces/route/__init__.py b/starlingx_dashboard/dashboards/admin/inventory/interfaces/route/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/interfaces/route/__init__.py
rename to starlingx_dashboard/dashboards/admin/inventory/interfaces/route/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/interfaces/route/forms.py b/starlingx_dashboard/dashboards/admin/inventory/interfaces/route/forms.py
similarity index 94%
rename from cgcs_dashboard/dashboards/admin/inventory/interfaces/route/forms.py
rename to starlingx_dashboard/dashboards/admin/inventory/interfaces/route/forms.py
index 175cab8c..f251e2ad 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/interfaces/route/forms.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/interfaces/route/forms.py
@@ -14,10 +14,6 @@
#
# Copyright (c) 2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/inventory/interfaces/route/tables.py b/starlingx_dashboard/dashboards/admin/inventory/interfaces/route/tables.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/interfaces/route/tables.py
rename to starlingx_dashboard/dashboards/admin/inventory/interfaces/route/tables.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/interfaces/route/views.py b/starlingx_dashboard/dashboards/admin/inventory/interfaces/route/views.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/interfaces/route/views.py
rename to starlingx_dashboard/dashboards/admin/inventory/interfaces/route/views.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/interfaces/tables.py b/starlingx_dashboard/dashboards/admin/inventory/interfaces/tables.py
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/inventory/interfaces/tables.py
rename to starlingx_dashboard/dashboards/admin/inventory/interfaces/tables.py
index b774966e..e6d89141 100644
--- a/cgcs_dashboard/dashboards/admin/inventory/interfaces/tables.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/interfaces/tables.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
import logging
@@ -130,7 +128,7 @@ def get_attributes(interface):
attrs.remove(a)
attr_str = ",".join(attrs)
- if 'False' in interface.dpdksupport:
+ if False in interface.dpdksupport:
attr_str = "%s, accelerated=%s" % (attr_str, 'False')
else:
attr_str = "%s, accelerated=%s" % (attr_str, 'True')
diff --git a/cgcs_dashboard/dashboards/admin/inventory/interfaces/tabs.py b/starlingx_dashboard/dashboards/admin/inventory/interfaces/tabs.py
similarity index 86%
rename from cgcs_dashboard/dashboards/admin/inventory/interfaces/tabs.py
rename to starlingx_dashboard/dashboards/admin/inventory/interfaces/tabs.py
index 30b12d3e..c263a3d5 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/interfaces/tabs.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/interfaces/tabs.py
@@ -16,10 +16,6 @@
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
from django.utils.translation import ugettext_lazy as _ # noqa
diff --git a/cgcs_dashboard/dashboards/admin/inventory/interfaces/views.py b/starlingx_dashboard/dashboards/admin/inventory/interfaces/views.py
similarity index 98%
rename from cgcs_dashboard/dashboards/admin/inventory/interfaces/views.py
rename to starlingx_dashboard/dashboards/admin/inventory/interfaces/views.py
index b4aeb6df..17a3c1ad 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/interfaces/views.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/interfaces/views.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/lldp/__init__.py b/starlingx_dashboard/dashboards/admin/inventory/lldp/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/lldp/__init__.py
rename to starlingx_dashboard/dashboards/admin/inventory/lldp/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/lldp/tables.py b/starlingx_dashboard/dashboards/admin/inventory/lldp/tables.py
similarity index 88%
rename from cgcs_dashboard/dashboards/admin/inventory/lldp/tables.py
rename to starlingx_dashboard/dashboards/admin/inventory/lldp/tables.py
index d1e89343..11a5c3d1 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/lldp/tables.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/lldp/tables.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/inventory/lldp/views.py b/starlingx_dashboard/dashboards/admin/inventory/lldp/views.py
similarity index 95%
rename from cgcs_dashboard/dashboards/admin/inventory/lldp/views.py
rename to starlingx_dashboard/dashboards/admin/inventory/lldp/views.py
index 7c4fb6b2..6476cf45 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/lldp/views.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/lldp/views.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/memorys/__init__.py b/starlingx_dashboard/dashboards/admin/inventory/memorys/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/memorys/__init__.py
rename to starlingx_dashboard/dashboards/admin/inventory/memorys/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/memorys/forms.py b/starlingx_dashboard/dashboards/admin/inventory/memorys/forms.py
similarity index 98%
rename from cgcs_dashboard/dashboards/admin/inventory/memorys/forms.py
rename to starlingx_dashboard/dashboards/admin/inventory/memorys/forms.py
index d1cb81d7..f89a24ce 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/memorys/forms.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/memorys/forms.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/memorys/tables.py b/starlingx_dashboard/dashboards/admin/inventory/memorys/tables.py
similarity index 83%
rename from cgcs_dashboard/dashboards/admin/inventory/memorys/tables.py
rename to starlingx_dashboard/dashboards/admin/inventory/memorys/tables.py
index 02035a1e..b8ee31af 100644
--- a/cgcs_dashboard/dashboards/admin/inventory/memorys/tables.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/memorys/tables.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
import logging
@@ -64,12 +62,6 @@ def get_processor_memory(memory):
return template.loader.render_to_string(template_name, context)
-def get_vswitch_hugepages(memory):
- template_name = 'admin/inventory/memorys/_vswitchfunction_hugepages.html'
- context = {"memory": memory}
- return template.loader.render_to_string(template_name, context)
-
-
def get_vm_hugepages(memory):
template_name = 'admin/inventory/memorys/_vmfunction_hugepages.html'
context = {"memory": memory}
@@ -83,9 +75,6 @@ class MemorysTable(tables.DataTable):
memory = tables.Column(get_processor_memory,
verbose_name=_('Memory'))
- vswitch_huge = tables.Column(get_vswitch_hugepages,
- verbose_name=_('VSwitch Huge Pages'))
-
vm_huge = tables.Column(get_vm_hugepages,
verbose_name=_('VM Pages'))
diff --git a/cgcs_dashboard/dashboards/admin/inventory/memorys/views.py b/starlingx_dashboard/dashboards/admin/inventory/memorys/views.py
similarity index 95%
rename from cgcs_dashboard/dashboards/admin/inventory/memorys/views.py
rename to starlingx_dashboard/dashboards/admin/inventory/memorys/views.py
index 370769a0..3039e477 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/memorys/views.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/memorys/views.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/panel.py b/starlingx_dashboard/dashboards/admin/inventory/panel.py
similarity index 78%
rename from cgcs_dashboard/dashboards/admin/inventory/panel.py
rename to starlingx_dashboard/dashboards/admin/inventory/panel.py
index dd3dc371..c65ecc13 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/panel.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/panel.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
@@ -22,12 +20,16 @@ class Inventory(horizon.Panel):
permissions = ('openstack.services.platform',)
def allowed(self, context):
+ if context['request'].user.services_region == 'SystemController':
+ return False
if not base.is_service_enabled(context['request'], 'platform'):
return False
else:
return super(Inventory, self).allowed(context)
def nav(self, context):
+ if context['request'].user.services_region == 'SystemController':
+ return False
if not base.is_service_enabled(context['request'], 'platform'):
return False
else:
diff --git a/cgcs_dashboard/dashboards/admin/inventory/ports/__init__.py b/starlingx_dashboard/dashboards/admin/inventory/ports/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/ports/__init__.py
rename to starlingx_dashboard/dashboards/admin/inventory/ports/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/ports/forms.py b/starlingx_dashboard/dashboards/admin/inventory/ports/forms.py
similarity index 95%
rename from cgcs_dashboard/dashboards/admin/inventory/ports/forms.py
rename to starlingx_dashboard/dashboards/admin/inventory/ports/forms.py
index 70284230..69292502 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/ports/forms.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/ports/forms.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/ports/tables.py b/starlingx_dashboard/dashboards/admin/inventory/ports/tables.py
similarity index 93%
rename from cgcs_dashboard/dashboards/admin/inventory/ports/tables.py
rename to starlingx_dashboard/dashboards/admin/inventory/ports/tables.py
index 99a72af8..fce3b940 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/ports/tables.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/ports/tables.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/inventory/ports/tabs.py b/starlingx_dashboard/dashboards/admin/inventory/ports/tabs.py
similarity index 85%
rename from cgcs_dashboard/dashboards/admin/inventory/ports/tabs.py
rename to starlingx_dashboard/dashboards/admin/inventory/ports/tabs.py
index 8b0e4654..03d87444 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/ports/tabs.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/ports/tabs.py
@@ -16,10 +16,6 @@
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
from django.utils.translation import ugettext_lazy as _ # noqa
diff --git a/cgcs_dashboard/dashboards/admin/inventory/ports/views.py b/starlingx_dashboard/dashboards/admin/inventory/ports/views.py
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/inventory/ports/views.py
rename to starlingx_dashboard/dashboards/admin/inventory/ports/views.py
index 76941a63..2ea01b95 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/ports/views.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/ports/views.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/sensors/__init__.py b/starlingx_dashboard/dashboards/admin/inventory/sensors/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/sensors/__init__.py
rename to starlingx_dashboard/dashboards/admin/inventory/sensors/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/sensors/forms.py b/starlingx_dashboard/dashboards/admin/inventory/sensors/forms.py
similarity index 97%
rename from cgcs_dashboard/dashboards/admin/inventory/sensors/forms.py
rename to starlingx_dashboard/dashboards/admin/inventory/sensors/forms.py
index f6782b08..7eeb6b60 100644
--- a/cgcs_dashboard/dashboards/admin/inventory/sensors/forms.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/sensors/forms.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/sensors/tables.py b/starlingx_dashboard/dashboards/admin/inventory/sensors/tables.py
similarity index 98%
rename from cgcs_dashboard/dashboards/admin/inventory/sensors/tables.py
rename to starlingx_dashboard/dashboards/admin/inventory/sensors/tables.py
index 5b02af27..0960b51e 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/sensors/tables.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/sensors/tables.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/inventory/sensors/views.py b/starlingx_dashboard/dashboards/admin/inventory/sensors/views.py
similarity index 97%
rename from cgcs_dashboard/dashboards/admin/inventory/sensors/views.py
rename to starlingx_dashboard/dashboards/admin/inventory/sensors/views.py
index 506c3287..dec8a7f9 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/sensors/views.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/sensors/views.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/storages/__init__.py b/starlingx_dashboard/dashboards/admin/inventory/storages/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/storages/__init__.py
rename to starlingx_dashboard/dashboards/admin/inventory/storages/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/storages/forms.py b/starlingx_dashboard/dashboards/admin/inventory/storages/forms.py
similarity index 94%
rename from cgcs_dashboard/dashboards/admin/inventory/storages/forms.py
rename to starlingx_dashboard/dashboards/admin/inventory/storages/forms.py
index 6c6657d1..a57a50bc 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/storages/forms.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/storages/forms.py
@@ -1,9 +1,7 @@
#
-# Copyright (c) 2013-2014, 2017 Wind River Systems, Inc.
+# Copyright (c) 2013-2018 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
@@ -183,6 +181,10 @@ class AddStorageVolume(forms.SelfHandlingForm):
initial='idisk_uuid',
widget=forms.widgets.HiddenInput)
+ tier_uuid = forms.CharField(label=_("tier_uuid"),
+ initial='tier_uuid',
+ widget=forms.widgets.HiddenInput)
+
hostname = forms.CharField(label=_("Hostname"),
initial='hostname',
widget=forms.TextInput(attrs={
@@ -200,7 +202,7 @@ class AddStorageVolume(forms.SelfHandlingForm):
widget=forms.Select(attrs={
'class': 'switchable',
'data-slug': 'disk'}),
- help_text=_("Assign disk to storage volume."))
+ help_text=_("Assign disk to a storage volume."))
journal_locations = forms.ChoiceField(label=_("Journal"),
required=False,
@@ -209,8 +211,9 @@ class AddStorageVolume(forms.SelfHandlingForm):
'data-switch-on': 'function',
'data-function-osd': _(
"Journal")}),
- help_text=_("Assign disk to journal "
- "storage volume."))
+ help_text=_("Assign disk to a "
+ "journal storage "
+ "volume."))
journal_size_mib = forms.CharField(label=_("Journal Size MiB"),
required=False,
@@ -223,6 +226,15 @@ class AddStorageVolume(forms.SelfHandlingForm):
help_text=_("Journal's size for the"
"current OSD."))
+ tiers = forms.ChoiceField(label=_("Storage Tier"),
+ required=False,
+ widget=forms.Select(attrs={
+ 'class': 'switched',
+ 'data-switch-on': 'function',
+ 'data-function-osd':
+ _("Storage Tier")}),
+ help_text=_("Assign OSD to a storage tier."))
+
failure_url = 'horizon:admin:inventory:detail'
def __init__(self, *args, **kwargs):
@@ -260,6 +272,15 @@ class AddStorageVolume(forms.SelfHandlingForm):
disk_model,
d.device_type)))
+ # Get the cluster
+ cluster_list = api.sysinv.cluster_list(self.request)
+ cluster_uuid = cluster_list[0].uuid
+
+ # Populate the available tiers for OSD assignment
+ avail_tier_list = api.sysinv.storage_tier_list(self.request,
+ cluster_uuid)
+ tier_tuple_list = [(t.uuid, t.name) for t in avail_tier_list]
+
# Populate available journal choices. If no journal is available,
# then the journal is collocated.
if ceph_caching:
@@ -285,6 +306,7 @@ class AddStorageVolume(forms.SelfHandlingForm):
self.fields['disks'].choices = disk_tuple_list
self.fields['journal_locations'].choices = journal_tuple_list
+ self.fields['tiers'].choices = tier_tuple_list
def clean(self):
cleaned_data = super(AddStorageVolume, self).clean()
@@ -299,10 +321,14 @@ class AddStorageVolume(forms.SelfHandlingForm):
host_id = data['host_id']
# host_uuid = data['ihost_uuid']
disks = data['disks'][:] # copy
+ tiers = data['tiers'][:] # copy
# GUI only allows one disk to be picked
data['idisk_uuid'] = disks
+ # GUI only allows one tier to be picked
+ data['tier_uuid'] = tiers
+
# Obtain journal information.
journal = data['journal_locations'][:]
@@ -315,6 +341,7 @@ class AddStorageVolume(forms.SelfHandlingForm):
try:
del data['host_id']
del data['disks']
+ del data['tiers']
del data['hostname']
del data['journal_locations']
@@ -539,9 +566,16 @@ class AddPhysicalVolume(forms.SelfHandlingForm):
partitions_tuple_list = []
ilvg_tuple_list = []
+ pv_cinder_volumes = next(
+ (pv for pv in ipv_list
+ if pv.lvm_vg_name == api.sysinv.LVG_CINDER_VOLUMES), None)
+
for lvg in ilvg_list:
if (lvg.lvm_vg_name in compatible_lvgs and
lvg.vg_state in [api.sysinv.LVG_ADD, api.sysinv.LVG_PROV]):
+ if (lvg.lvm_vg_name == api.sysinv.LVG_CINDER_VOLUMES and
+ pv_cinder_volumes):
+ continue
ilvg_tuple_list.append((lvg.uuid, lvg.lvm_vg_name))
for disk in avail_disk_list:
diff --git a/cgcs_dashboard/dashboards/admin/inventory/storages/lvg_params/__init__.py b/starlingx_dashboard/dashboards/admin/inventory/storages/lvg_params/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/storages/lvg_params/__init__.py
rename to starlingx_dashboard/dashboards/admin/inventory/storages/lvg_params/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/inventory/storages/lvg_params/forms.py b/starlingx_dashboard/dashboards/admin/inventory/storages/lvg_params/forms.py
similarity index 98%
rename from cgcs_dashboard/dashboards/admin/inventory/storages/lvg_params/forms.py
rename to starlingx_dashboard/dashboards/admin/inventory/storages/lvg_params/forms.py
index a7940537..951cd679 100644
--- a/cgcs_dashboard/dashboards/admin/inventory/storages/lvg_params/forms.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/storages/lvg_params/forms.py
@@ -2,9 +2,7 @@
# Copyright (c) 2015-2017 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/inventory/storages/lvg_params/tables.py b/starlingx_dashboard/dashboards/admin/inventory/storages/lvg_params/tables.py
similarity index 91%
rename from cgcs_dashboard/dashboards/admin/inventory/storages/lvg_params/tables.py
rename to starlingx_dashboard/dashboards/admin/inventory/storages/lvg_params/tables.py
index 1a5c36cf..12b15ca0 100644
--- a/cgcs_dashboard/dashboards/admin/inventory/storages/lvg_params/tables.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/storages/lvg_params/tables.py
@@ -2,9 +2,7 @@
# Copyright (c) 2015-2017 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
from django.core.urlresolvers import reverse # noqa
diff --git a/cgcs_dashboard/dashboards/admin/inventory/storages/lvg_params/urls.py b/starlingx_dashboard/dashboards/admin/inventory/storages/lvg_params/urls.py
similarity index 65%
rename from cgcs_dashboard/dashboards/admin/inventory/storages/lvg_params/urls.py
rename to starlingx_dashboard/dashboards/admin/inventory/storages/lvg_params/urls.py
index c7d4a27d..b1d8675a 100644
--- a/cgcs_dashboard/dashboards/admin/inventory/storages/lvg_params/urls.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/storages/lvg_params/urls.py
@@ -2,9 +2,7 @@
# Copyright (c) 2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
from django.conf.urls import url # noqa
diff --git a/cgcs_dashboard/dashboards/admin/inventory/storages/lvg_params/views.py b/starlingx_dashboard/dashboards/admin/inventory/storages/lvg_params/views.py
similarity index 90%
rename from cgcs_dashboard/dashboards/admin/inventory/storages/lvg_params/views.py
rename to starlingx_dashboard/dashboards/admin/inventory/storages/lvg_params/views.py
index 3928c330..3d3224f6 100644
--- a/cgcs_dashboard/dashboards/admin/inventory/storages/lvg_params/views.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/storages/lvg_params/views.py
@@ -2,9 +2,7 @@
# Copyright (c) 2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/inventory/storages/tables.py b/starlingx_dashboard/dashboards/admin/inventory/storages/tables.py
similarity index 92%
rename from cgcs_dashboard/dashboards/admin/inventory/storages/tables.py
rename to starlingx_dashboard/dashboards/admin/inventory/storages/tables.py
index 59a6768c..279a2d16 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/storages/tables.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/storages/tables.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2015, 2017 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
import logging
@@ -176,15 +174,26 @@ class EditPartition(tables.LinkAction):
PARTITION_STATUS_MSG = api.sysinv.PARTITION_STATUS_MSG
if partition:
+ pv = None
+
if partition.type_guid != api.sysinv.USER_PARTITION_PHYS_VOL:
return False
+ if partition.ipv_uuid:
+ pv = api.sysinv.host_pv_get(
+ request, partition.ipv_uuid)
+ if pv.lvm_vg_name == api.sysinv.LVG_CINDER_VOLUMES:
+ if (host.personality == "Controller-Active" and
+ host._administrative == 'unlocked'):
+ return False
+ else:
+ return False
+
if (partition.status ==
PARTITION_STATUS_MSG[PARTITION_IN_USE_STATUS]):
- return False
-
- if partition.ipv_uuid:
- return False
+ if not (pv and
+ pv.lvm_vg_name == api.sysinv.LVG_CINDER_VOLUMES):
+ return False
# Get all the partitions from the same disk.
disk_partitions = \
@@ -421,14 +430,18 @@ class RemoveLocalVolumeGroup(tables.DeleteAction):
def allowed(self, request, lvg=None):
host = self.table.kwargs['host']
- return ((((host._administrative == 'locked') or
- (('compute' in host._subfunctions) and
- (host.compute_config_required is True))) and
- (lvg.lvm_vg_name == api.sysinv.LVG_NOVA_LOCAL)) or
- ((api.sysinv.CINDER_BACKEND_LVM in
- api.sysinv.get_cinder_backend(request)) and
- (lvg.lvm_vg_name == api.sysinv.LVG_CINDER_VOLUMES) and
- (api.sysinv.LVG_ADD in lvg.vg_state)))
+ cinder_backend = api.sysinv.get_cinder_backend(request)
+
+ if lvg.lvm_vg_name == api.sysinv.LVG_NOVA_LOCAL:
+ return ((host._administrative == 'locked')
+ or
+ (('compute' in host._subfunctions) and
+ (host.compute_config_required is True)))
+ elif lvg.lvm_vg_name == api.sysinv.LVG_CINDER_VOLUMES:
+ return (api.sysinv.CINDER_BACKEND_LVM not in cinder_backend and
+ api.sysinv.LVG_ADD in lvg.vg_state)
+
+ return False
def delete(self, request, lvg_id):
host_id = self.table.kwargs['host_id']
@@ -539,14 +552,18 @@ class RemovePhysicalVolume(tables.DeleteAction):
def allowed(self, request, pv=None):
host = self.table.kwargs['host']
- return ((((host._administrative == 'locked') or
- (('compute' in host._subfunctions) and
- (host.compute_config_required is True))) and
- (pv.lvm_vg_name == api.sysinv.LVG_NOVA_LOCAL)) or
- ((api.sysinv.CINDER_BACKEND_LVM in
- api.sysinv.get_cinder_backend(request)) and
- ((pv.lvm_vg_name == api.sysinv.LVG_CINDER_VOLUMES) and
- (api.sysinv.PV_ADD in pv.pv_state))))
+ cinder_backend = api.sysinv.get_cinder_backend(request)
+
+ if pv.lvm_vg_name == api.sysinv.LVG_NOVA_LOCAL:
+ return ((host._administrative == 'locked')
+ or
+ (('compute' in host._subfunctions) and
+ (host.compute_config_required is True)))
+ elif pv.lvm_vg_name == api.sysinv.LVG_CINDER_VOLUMES:
+ return (api.sysinv.CINDER_BACKEND_LVM not in cinder_backend and
+ api.sysinv.PV_ADD in pv.pv_state)
+
+ return False
def delete(self, request, pv_id):
host_id = self.table.kwargs['host_id']
diff --git a/cgcs_dashboard/dashboards/admin/inventory/storages/tabs.py b/starlingx_dashboard/dashboards/admin/inventory/storages/tabs.py
similarity index 91%
rename from cgcs_dashboard/dashboards/admin/inventory/storages/tabs.py
rename to starlingx_dashboard/dashboards/admin/inventory/storages/tabs.py
index 52d95020..299e2bf3 100644
--- a/cgcs_dashboard/dashboards/admin/inventory/storages/tabs.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/storages/tabs.py
@@ -2,9 +2,7 @@
# Copyright (c) 2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/inventory/storages/urls.py b/starlingx_dashboard/dashboards/admin/inventory/storages/urls.py
similarity index 68%
rename from cgcs_dashboard/dashboards/admin/inventory/storages/urls.py
rename to starlingx_dashboard/dashboards/admin/inventory/storages/urls.py
index aab3c1d7..14970fe0 100644
--- a/cgcs_dashboard/dashboards/admin/inventory/storages/urls.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/storages/urls.py
@@ -2,9 +2,7 @@
# Copyright (c) 2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
from django.conf.urls import include # noqa
diff --git a/cgcs_dashboard/dashboards/admin/inventory/storages/views.py b/starlingx_dashboard/dashboards/admin/inventory/storages/views.py
similarity index 98%
rename from cgcs_dashboard/dashboards/admin/inventory/storages/views.py
rename to starlingx_dashboard/dashboards/admin/inventory/storages/views.py
index d74fd135..032ceb31 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/storages/views.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/storages/views.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2015, 2017 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
@@ -168,6 +166,7 @@ class AddDiskProfileView(forms.ModalFormView):
if count > 1:
setattr(s, "count",
journals[s.journal_location])
+ setattr(s, "tier_name", s.tier_name)
s.disks = [d.device_path
for d in all_disks if
diff --git a/cgcs_dashboard/dashboards/admin/inventory/tables.py b/starlingx_dashboard/dashboards/admin/inventory/tables.py
similarity index 99%
rename from cgcs_dashboard/dashboards/admin/inventory/tables.py
rename to starlingx_dashboard/dashboards/admin/inventory/tables.py
index 29e2eda7..34e42a2a 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/tables.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/tables.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2017 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/inventory/tabs.py b/starlingx_dashboard/dashboards/admin/inventory/tabs.py
similarity index 99%
rename from cgcs_dashboard/dashboards/admin/inventory/tabs.py
rename to starlingx_dashboard/dashboards/admin/inventory/tabs.py
index 2b1759bc..f72a9dc1 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/tabs.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/tabs.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2017 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_cpuprofiles.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_cpuprofiles.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_cpuprofiles.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_cpuprofiles.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_cpuprofiles_cpuassignments.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_cpuprofiles_cpuassignments.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_cpuprofiles_cpuassignments.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_cpuprofiles_cpuassignments.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_create.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_create.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_create.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_create.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_cpufunctions.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_cpufunctions.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_cpufunctions.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_cpufunctions.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_devices.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_devices.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_devices.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_devices.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_interfaces.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_interfaces.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_interfaces.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_interfaces.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_lldp.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_lldp.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_lldp.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_lldp.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_local_volume_group.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_local_volume_group.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_local_volume_group.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_local_volume_group.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_local_volume_group_overview.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_local_volume_group_overview.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_local_volume_group_overview.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_local_volume_group_overview.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_memorys.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_memorys.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_memorys.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_memorys.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_neighbour.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_neighbour.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_neighbour.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_neighbour.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_overview.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_overview.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_overview.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_overview.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_physical_volume.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_physical_volume.html
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_physical_volume.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_physical_volume.html
index d94ba4e5..5b161ff2 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_physical_volume.html
+++ b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_physical_volume.html
@@ -1,54 +1,54 @@
-{% extends 'base.html' %}
-{% load i18n breadcrumb_nav %}
-{% block title %}{% trans "Physical Volume Details" %}{% endblock %}
-
-{% block main %}
-
+{% endblock %}
+
+
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_ports.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_ports.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_ports.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_ports.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensor.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensor.html
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensor.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensor.html
index f2cd609c..19af11b6 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensor.html
+++ b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensor.html
@@ -1,56 +1,56 @@
-{% extends 'base.html' %}
-{% load i18n breadcrumb_nav %}
-{% block title %}{% trans "Sensor Details" %}{% endblock %}
-
-{% block main %}
-
{{ sensor.sensorname }}
-
-
-
-
-
{% trans "Info" %}
-
-
-
{% trans "UUID" %}
-
{{ sensor.uuid }}
-
{% trans "Status" %}
-
{{ sensor.status }}
-
{% trans "State" %}
-
{{ sensor.state }}
-
{% trans "SensorType" %}
-
{{ sensor.sensortype }}
-
{% trans "DataType" %}
-
{{ sensor.datatype }}
-
-
-
{% trans "Sensor UUID" %}
-
{{ sensor.uuid }}
-
{% trans "Sensor Name" %}
-
{{ sensor.sensorname }}
-
-
-
{% trans "Suppressed" %}
-
{{ sensor.suppress }}
-
{% trans "Minor Actions" %}
-
{{ sensor.actions_minor }}
-
{% trans "Major Actions" %}
-
{{ sensor.actions_major }}
-
{% trans "Critical Actions" %}
-
{{ sensor.actions_critical }}
-
-
-
{% trans "Sensor Group UUID" %}
-
{{ sensor.sensorgroup_uuid }}
-
-
-
{% trans "Created At" %}
-
{{ sensor.created_at }}
-
{% trans "Updated At" %}
-
{{ sensor.updated_at }}
-
-
-
-
-{% endblock %}
-
-
+{% extends 'base.html' %}
+{% load i18n breadcrumb_nav %}
+{% block title %}{% trans "Sensor Details" %}{% endblock %}
+
+{% block main %}
+
{{ sensor.sensorname }}
+
+
+
+
+
{% trans "Info" %}
+
+
+
{% trans "UUID" %}
+
{{ sensor.uuid }}
+
{% trans "Status" %}
+
{{ sensor.status }}
+
{% trans "State" %}
+
{{ sensor.state }}
+
{% trans "SensorType" %}
+
{{ sensor.sensortype }}
+
{% trans "DataType" %}
+
{{ sensor.datatype }}
+
+
+
{% trans "Sensor UUID" %}
+
{{ sensor.uuid }}
+
{% trans "Sensor Name" %}
+
{{ sensor.sensorname }}
+
+
+
{% trans "Suppressed" %}
+
{{ sensor.suppress }}
+
{% trans "Minor Actions" %}
+
{{ sensor.actions_minor }}
+
{% trans "Major Actions" %}
+
{{ sensor.actions_major }}
+
{% trans "Critical Actions" %}
+
{{ sensor.actions_critical }}
+
+
+
{% trans "Sensor Group UUID" %}
+
{{ sensor.sensorgroup_uuid }}
+
+
+
{% trans "Created At" %}
+
{{ sensor.created_at }}
+
{% trans "Updated At" %}
+
{{ sensor.updated_at }}
+
+
+
+
+{% endblock %}
+
+
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensor_group.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensor_group.html
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensor_group.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensor_group.html
index 9ae8fe9f..88af9e97 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensor_group.html
+++ b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensor_group.html
@@ -1,48 +1,48 @@
-{% extends 'base.html' %}
-{% load i18n breadcrumb_nav %}
-{% block title %}{% trans "Sensor Group Details" %}{% endblock %}
-
-{% block main %}
-
{{ sensorgroup.sensorgroupname }}
-
-
-
-
-
{% trans "Info" %}
-
-
-
{% trans "UUID" %}
-
{{ sensorgroup.uuid }}
-
{% trans "Group Name" %}
-
{{ sensorgroup.sensorgroupname }}
-
{% trans "Group Type" %}
-
{{ sensorgroup.sensortype }}
-
{% trans "State" %}
-
{{ sensorgroup.state }}
-
-
-
{% trans "Datatype" %}
-
{{ sensorgroup.datatype }}
-
{% trans "Audit Interval (secs)" %}
-
{{ sensorgroup.audit_interval_group }}
-
{% trans "Algorithm" %}
-
{{ sensorgroup.algorithm }}
-
{% trans "Actions Minor" %}
-
{{ sensorgroup.actions_minor_group }}
-
{% trans "Actions Major" %}
-
{{ sensorgroup.actions_major_group }}
-
{% trans "Actions Critical" %}
-
{{ sensorgroup.actions_critical_group }}
-
-
-
{% trans "Created At" %}
-
{{ sensorgroup.created_at }}
-
{% trans "Updated At" %}
-
{{ sensorgroup.updated_at }}
-
-
-
-
-{% endblock %}
-
-
+{% extends 'base.html' %}
+{% load i18n breadcrumb_nav %}
+{% block title %}{% trans "Sensor Group Details" %}{% endblock %}
+
+{% block main %}
+
{{ sensorgroup.sensorgroupname }}
+
+
+
+
+
{% trans "Info" %}
+
+
+
{% trans "UUID" %}
+
{{ sensorgroup.uuid }}
+
{% trans "Group Name" %}
+
{{ sensorgroup.sensorgroupname }}
+
{% trans "Group Type" %}
+
{{ sensorgroup.sensortype }}
+
{% trans "State" %}
+
{{ sensorgroup.state }}
+
+
+
{% trans "Datatype" %}
+
{{ sensorgroup.datatype }}
+
{% trans "Audit Interval (secs)" %}
+
{{ sensorgroup.audit_interval_group }}
+
{% trans "Algorithm" %}
+
{{ sensorgroup.algorithm }}
+
{% trans "Actions Minor" %}
+
{{ sensorgroup.actions_minor_group }}
+
{% trans "Actions Major" %}
+
{{ sensorgroup.actions_major_group }}
+
{% trans "Actions Critical" %}
+
{{ sensorgroup.actions_critical_group }}
+
+
+
{% trans "Created At" %}
+
{{ sensorgroup.created_at }}
+
{% trans "Updated At" %}
+
{{ sensorgroup.updated_at }}
+
+
+
+
+{% endblock %}
+
+
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensors.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensors.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensors.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_sensors.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_storages.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_storages.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_detail_storages.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_detail_storages.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_deviceusage.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_deviceusage.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_deviceusage.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_deviceusage.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_disk_info.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_disk_info.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_disk_info.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_disk_info.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_diskconfig.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_diskconfig.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_diskconfig.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_diskconfig.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_diskconfig_obs.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_diskconfig_obs.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_diskconfig_obs.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_diskconfig_obs.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_lvgconfig.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_lvgconfig.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_lvgconfig.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_lvgconfig.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_partitionconfig.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_partitionconfig.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_partitionconfig.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_partitionconfig.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_storconfig.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_storconfig.html
similarity index 90%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_storconfig.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_storconfig.html
index 1fa58e13..b6bd0ed1 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_storconfig.html
+++ b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_diskprofiles_storconfig.html
@@ -16,9 +16,10 @@
{% else %}
{{ "on journal stor" }} {{stor.count}}
{% endif %}
+ {{", for tier:"}} {{stor.tier_name}}
{% else %}
{{ stor.function }} {{"stor"}} {{stor.count}}
- {% endif %}
+ {% endif %}
{% endif %}
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_hosts.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_hosts.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_hosts.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_hosts.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_interfaceprofiles.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_interfaceprofiles.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_interfaceprofiles.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_interfaceprofiles.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_interfaceprofiles_interfaceconfig.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_interfaceprofiles_interfaceconfig.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_interfaceprofiles_interfaceconfig.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_interfaceprofiles_interfaceconfig.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_interfaceprofiles_portconfig.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_interfaceprofiles_portconfig.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_interfaceprofiles_portconfig.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_interfaceprofiles_portconfig.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_memoryprofiles.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_memoryprofiles.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_memoryprofiles.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_memoryprofiles.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_memoryprofiles_memoryassignments.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_memoryprofiles_memoryassignments.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_memoryprofiles_memoryassignments.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_memoryprofiles_memoryassignments.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_update.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_update.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/_update.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/_update.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/banner.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/banner.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/banner.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/banner.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/_cpufunction_processorcores.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/_cpufunction_processorcores.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/_cpufunction_processorcores.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/_cpufunction_processorcores.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/_createprofile.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/_createprofile.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/_createprofile.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/_createprofile.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/_update.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/_update.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/_update.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/_update.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/createprofile.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/createprofile.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/createprofile.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/createprofile.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/update.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/update.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/update.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/cpu_functions/update.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/create.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/create.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/create.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/create.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/detail.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/detail.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/detail.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/detail.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/devices/_detail_overview.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/devices/_detail_overview.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/devices/_detail_overview.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/devices/_detail_overview.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/devices/_update.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/devices/_update.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/devices/_update.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/devices/_update.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/devices/_usage.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/devices/_usage.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/devices/_usage.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/devices/_usage.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/devices/detail.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/devices/detail.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/devices/detail.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/devices/detail.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/devices/update.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/devices/update.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/devices/update.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/devices/update.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/devices/usage.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/devices/usage.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/devices/usage.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/devices/usage.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/index.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/index.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/index.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/index.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_create.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_create.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_create.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_create.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_createprofile.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_createprofile.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_createprofile.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_createprofile.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_detail_overview.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_detail_overview.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_detail_overview.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_detail_overview.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_update.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_update.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_update.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/_update.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/address/_create.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/address/_create.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/address/_create.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/address/_create.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/address/create.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/address/create.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/address/create.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/address/create.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/create.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/create.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/create.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/create.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/createprofile.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/createprofile.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/createprofile.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/createprofile.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/detail.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/detail.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/detail.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/detail.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/route/_create.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/route/_create.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/route/_create.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/route/_create.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/route/create.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/route/create.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/route/create.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/route/create.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/update.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/update.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/update.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/interfaces/update.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_createprofile.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_createprofile.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_createprofile.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_createprofile.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_edit_hp_memory.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_edit_hp_memory.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_edit_hp_memory.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_edit_hp_memory.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_memoryfunction_hugepages.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_memoryfunction_hugepages.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_memoryfunction_hugepages.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_memoryfunction_hugepages.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_memoryfunction_hugepages_other.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_memoryfunction_hugepages_other.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_memoryfunction_hugepages_other.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_memoryfunction_hugepages_other.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_vmfunction_hugepages.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_vmfunction_hugepages.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_vmfunction_hugepages.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_vmfunction_hugepages.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_vswitchfunction_hugepages.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_vswitchfunction_hugepages.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_vswitchfunction_hugepages.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/_vswitchfunction_hugepages.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/createprofile.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/createprofile.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/createprofile.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/createprofile.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/edit_hp_memory.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/edit_hp_memory.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/memorys/edit_hp_memory.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/memorys/edit_hp_memory.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/ports/_detail_overview.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/ports/_detail_overview.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/ports/_detail_overview.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/ports/_detail_overview.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/ports/_ports_devicetype.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/ports/_ports_devicetype.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/ports/_ports_devicetype.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/ports/_ports_devicetype.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/ports/_update.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/ports/_update.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/ports/_update.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/ports/_update.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/ports/detail.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/ports/detail.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/ports/detail.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/ports/detail.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/ports/update.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/ports/update.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/ports/update.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/ports/update.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_createsensorgroup.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_createsensorgroup.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_createsensorgroup.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_createsensorgroup.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_sensor_actions.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_sensor_actions.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_sensor_actions.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_sensor_actions.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_sensorgroup_actions.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_sensorgroup_actions.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_sensorgroup_actions.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_sensorgroup_actions.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_updatesensorgroup.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_updatesensorgroup.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_updatesensorgroup.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/sensors/_updatesensorgroup.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/sensors/createsensorgroup.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/sensors/createsensorgroup.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/sensors/createsensorgroup.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/sensors/createsensorgroup.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/sensors/updatesensorgroup.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/sensors/updatesensorgroup.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/sensors/updatesensorgroup.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/sensors/updatesensorgroup.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_creatediskprofile.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/_creatediskprofile.html
similarity index 98%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_creatediskprofile.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/_creatediskprofile.html
index 687cf0de..abd0743e 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_creatediskprofile.html
+++ b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/_creatediskprofile.html
@@ -40,6 +40,7 @@
{% else %}
{{ "on journal stor" }} {{stor.count}}
{% endif %}
+ {{", for tier:"}} {{stor.tier_name}}
{% else %}
{{ stor.function }} {{"stor"}} {{stor.count}}
{% endif %}
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createlocalvolumegroup.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createlocalvolumegroup.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createlocalvolumegroup.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createlocalvolumegroup.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createpartition.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createpartition.html
similarity index 90%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createpartition.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createpartition.html
index 716fce4c..63012c2b 100644
--- a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createpartition.html
+++ b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createpartition.html
@@ -13,7 +13,7 @@
{% trans "Description" %}:
-
{% trans "From here you can create a new partition." %}
+
{% trans "From here you can create a new disk partition." %}
{% trans "From here you can define the configuration of a new physical volume." %}
+
+{% endblock %}
+
+{% block modal-footer %}
+ Cancel
+
+{% endblock %}
+
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createstoragevolume.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createstoragevolume.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createstoragevolume.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/_createstoragevolume.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_editpartition.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/_editpartition.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_editpartition.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/_editpartition.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_editstoragevolume.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/_editstoragevolume.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/_editstoragevolume.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/_editstoragevolume.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/creatediskprofile.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/creatediskprofile.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/creatediskprofile.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/creatediskprofile.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/createlocalvolumegroup.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/createlocalvolumegroup.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/createlocalvolumegroup.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/createlocalvolumegroup.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/createpartition.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/createpartition.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/createpartition.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/createpartition.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/createphysicalvolume.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/createphysicalvolume.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/createphysicalvolume.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/createphysicalvolume.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/createstoragevolume.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/createstoragevolume.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/createstoragevolume.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/createstoragevolume.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/editpartition.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/editpartition.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/editpartition.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/editpartition.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/editstoragevolume.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/editstoragevolume.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/editstoragevolume.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/editstoragevolume.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/lvg/_edit.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/lvg/_edit.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/lvg/_edit.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/lvg/_edit.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/lvg/edit.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/lvg/edit.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/storages/lvg/edit.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/storages/lvg/edit.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/templates/inventory/update.html b/starlingx_dashboard/dashboards/admin/inventory/templates/inventory/update.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/inventory/templates/inventory/update.html
rename to starlingx_dashboard/dashboards/admin/inventory/templates/inventory/update.html
diff --git a/cgcs_dashboard/dashboards/admin/inventory/urls.py b/starlingx_dashboard/dashboards/admin/inventory/urls.py
similarity index 97%
rename from cgcs_dashboard/dashboards/admin/inventory/urls.py
rename to starlingx_dashboard/dashboards/admin/inventory/urls.py
index 694b1811..a8bc78f9 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/urls.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/urls.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2017 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/views.py b/starlingx_dashboard/dashboards/admin/inventory/views.py
similarity index 97%
rename from cgcs_dashboard/dashboards/admin/inventory/views.py
rename to starlingx_dashboard/dashboards/admin/inventory/views.py
index e84fa4f5..14921a43 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/views.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/views.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2017 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/inventory/workflows.py b/starlingx_dashboard/dashboards/admin/inventory/workflows.py
similarity index 99%
rename from cgcs_dashboard/dashboards/admin/inventory/workflows.py
rename to starlingx_dashboard/dashboards/admin/inventory/workflows.py
index 23f26bd9..90c9b4ee 100755
--- a/cgcs_dashboard/dashboards/admin/inventory/workflows.py
+++ b/starlingx_dashboard/dashboards/admin/inventory/workflows.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
diff --git a/cgcs_dashboard/dashboards/admin/providernets/__init__.py b/starlingx_dashboard/dashboards/admin/providernets/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/__init__.py
rename to starlingx_dashboard/dashboards/admin/providernets/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/providernets/panel.py b/starlingx_dashboard/dashboards/admin/providernets/panel.py
similarity index 69%
rename from cgcs_dashboard/dashboards/admin/providernets/panel.py
rename to starlingx_dashboard/dashboards/admin/providernets/panel.py
index 0424a21d..5eccc564 100755
--- a/cgcs_dashboard/dashboards/admin/providernets/panel.py
+++ b/starlingx_dashboard/dashboards/admin/providernets/panel.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
from django.utils.translation import ugettext_lazy as _
@@ -16,15 +14,19 @@ from openstack_dashboard.dashboards.admin import dashboard
class Providernets(horizon.Panel):
name = _("Provider Networks")
slug = 'providernets'
- permissions = ('openstack.services.platform',)
+ permissions = ('openstack.services.platform', 'openstack.services.network')
def allowed(self, context):
+ if context['request'].user.services_region == 'SystemController':
+ return False
if not base.is_service_enabled(context['request'], 'platform'):
return False
else:
return super(Providernets, self).allowed(context)
def nav(self, context):
+ if context['request'].user.services_region == 'SystemController':
+ return False
if not base.is_service_enabled(context['request'], 'platform'):
return False
else:
diff --git a/cgcs_dashboard/dashboards/admin/providernets/providernets/__init__.py b/starlingx_dashboard/dashboards/admin/providernets/providernets/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/providernets/__init__.py
rename to starlingx_dashboard/dashboards/admin/providernets/providernets/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/providernets/providernets/forms.py b/starlingx_dashboard/dashboards/admin/providernets/providernets/forms.py
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/providernets/providernets/forms.py
rename to starlingx_dashboard/dashboards/admin/providernets/providernets/forms.py
index f474c2c3..f6b1e58f 100755
--- a/cgcs_dashboard/dashboards/admin/providernets/providernets/forms.py
+++ b/starlingx_dashboard/dashboards/admin/providernets/providernets/forms.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -16,10 +14,6 @@
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/__init__.py b/starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/__init__.py
rename to starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/forms.py b/starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/forms.py
similarity index 98%
rename from cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/forms.py
rename to starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/forms.py
index 8fa76781..eef818b0 100755
--- a/cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/forms.py
+++ b/starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/forms.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -16,10 +14,6 @@
#
# Copyright (c) 2013-2015,2017 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/tables.py b/starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/tables.py
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/tables.py
rename to starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/tables.py
index 5accf0c2..f8662532 100755
--- a/cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/tables.py
+++ b/starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/tables.py
@@ -16,10 +16,6 @@
#
# Copyright (c) 2013-2014,2017 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/tabs.py b/starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/tabs.py
similarity index 87%
rename from cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/tabs.py
rename to starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/tabs.py
index d7f0a289..a6b68bcc 100755
--- a/cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/tabs.py
+++ b/starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/tabs.py
@@ -16,10 +16,6 @@
#
# Copyright (c) 2013-2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
from django.utils.translation import ugettext_lazy as _ # noqa
diff --git a/cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/urls.py b/starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/urls.py
similarity index 84%
rename from cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/urls.py
rename to starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/urls.py
index 6882f1b1..09c6f22b 100755
--- a/cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/urls.py
+++ b/starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/urls.py
@@ -16,10 +16,6 @@
#
# Copyright (c) 2013-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
from django.conf.urls import url # noqa
diff --git a/cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/views.py b/starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/views.py
similarity index 97%
rename from cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/views.py
rename to starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/views.py
index 8b8a824f..52612841 100755
--- a/cgcs_dashboard/dashboards/admin/providernets/providernets/ranges/views.py
+++ b/starlingx_dashboard/dashboards/admin/providernets/providernets/ranges/views.py
@@ -16,10 +16,6 @@
#
# Copyright (c) 2013-2017 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
from django.core.urlresolvers import reverse # noqa
diff --git a/cgcs_dashboard/dashboards/admin/providernets/providernets/tables.py b/starlingx_dashboard/dashboards/admin/providernets/providernets/tables.py
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/providernets/providernets/tables.py
rename to starlingx_dashboard/dashboards/admin/providernets/providernets/tables.py
index e5677ddf..92af980b 100755
--- a/cgcs_dashboard/dashboards/admin/providernets/providernets/tables.py
+++ b/starlingx_dashboard/dashboards/admin/providernets/providernets/tables.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -16,10 +14,6 @@
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
import logging
diff --git a/cgcs_dashboard/dashboards/admin/providernets/providernets/urls.py b/starlingx_dashboard/dashboards/admin/providernets/providernets/urls.py
similarity index 89%
rename from cgcs_dashboard/dashboards/admin/providernets/providernets/urls.py
rename to starlingx_dashboard/dashboards/admin/providernets/providernets/urls.py
index 55434714..eb519726 100755
--- a/cgcs_dashboard/dashboards/admin/providernets/providernets/urls.py
+++ b/starlingx_dashboard/dashboards/admin/providernets/providernets/urls.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -16,10 +14,6 @@
#
# Copyright (c) 2013-2015 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
from django.conf.urls import include # noqa
diff --git a/cgcs_dashboard/dashboards/admin/providernets/providernets/views.py b/starlingx_dashboard/dashboards/admin/providernets/providernets/views.py
similarity index 97%
rename from cgcs_dashboard/dashboards/admin/providernets/providernets/views.py
rename to starlingx_dashboard/dashboards/admin/providernets/providernets/views.py
index 6c6b86a2..d79b9ffe 100755
--- a/cgcs_dashboard/dashboards/admin/providernets/providernets/views.py
+++ b/starlingx_dashboard/dashboards/admin/providernets/providernets/views.py
@@ -1,5 +1,3 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -16,10 +14,6 @@
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
from collections import OrderedDict
diff --git a/cgcs_dashboard/dashboards/admin/providernets/tabs.py b/starlingx_dashboard/dashboards/admin/providernets/tabs.py
similarity index 87%
rename from cgcs_dashboard/dashboards/admin/providernets/tabs.py
rename to starlingx_dashboard/dashboards/admin/providernets/tabs.py
index 0a508581..0c020429 100755
--- a/cgcs_dashboard/dashboards/admin/providernets/tabs.py
+++ b/starlingx_dashboard/dashboards/admin/providernets/tabs.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_add_range.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_add_range.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_add_range.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_add_range.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_create.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_create.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_create.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_create.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_detail_overview.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_detail_overview.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_detail_overview.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_detail_overview.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_update.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_update.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_update.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/_update.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/add_range.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/add_range.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/add_range.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/add_range.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/create.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/create.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/create.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/create.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/detail.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/detail.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/detail.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/detail.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_create.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_create.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_create.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_create.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_detail_overview.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_detail_overview.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_detail_overview.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_detail_overview.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_update.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_update.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_update.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_update.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_vxlan.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_vxlan.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_vxlan.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/_vxlan.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/create.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/create.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/create.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/create.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/detail.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/detail.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/detail.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/detail.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/update.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/update.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/update.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/ranges/update.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/update.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/update.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/providernets/update.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/providernets/update.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/templates/providernets/tabs.html b/starlingx_dashboard/dashboards/admin/providernets/templates/providernets/tabs.html
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/providernets/templates/providernets/tabs.html
rename to starlingx_dashboard/dashboards/admin/providernets/templates/providernets/tabs.html
diff --git a/cgcs_dashboard/dashboards/admin/providernets/urls.py b/starlingx_dashboard/dashboards/admin/providernets/urls.py
similarity index 74%
rename from cgcs_dashboard/dashboards/admin/providernets/urls.py
rename to starlingx_dashboard/dashboards/admin/providernets/urls.py
index afadd4c0..b459b047 100755
--- a/cgcs_dashboard/dashboards/admin/providernets/urls.py
+++ b/starlingx_dashboard/dashboards/admin/providernets/urls.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
from django.conf.urls import include
diff --git a/cgcs_dashboard/dashboards/admin/providernets/views.py b/starlingx_dashboard/dashboards/admin/providernets/views.py
similarity index 70%
rename from cgcs_dashboard/dashboards/admin/providernets/views.py
rename to starlingx_dashboard/dashboards/admin/providernets/views.py
index e75bfdf2..71b67f6c 100755
--- a/cgcs_dashboard/dashboards/admin/providernets/views.py
+++ b/starlingx_dashboard/dashboards/admin/providernets/views.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
from django.utils.translation import ugettext_lazy as _
diff --git a/cgcs_dashboard/dashboards/admin/server_groups/__init__.py b/starlingx_dashboard/dashboards/admin/server_groups/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/server_groups/__init__.py
rename to starlingx_dashboard/dashboards/admin/server_groups/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/server_groups/forms.py b/starlingx_dashboard/dashboards/admin/server_groups/forms.py
similarity index 94%
rename from cgcs_dashboard/dashboards/admin/server_groups/forms.py
rename to starlingx_dashboard/dashboards/admin/server_groups/forms.py
index 1d99fd02..1a591716 100755
--- a/cgcs_dashboard/dashboards/admin/server_groups/forms.py
+++ b/starlingx_dashboard/dashboards/admin/server_groups/forms.py
@@ -1,200 +1,194 @@
-# 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.
-#
-# Copyright (c) 2013-2017 Wind River Systems, Inc.
-#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
-
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright 2012 Nebula, Inc.
-# All rights reserved.
-
-"""
-Views for managing volumes.
-"""
-
-from django.conf import settings
-from django.core.urlresolvers import reverse
-from django.forms import ValidationError
-from django.utils.translation import ugettext_lazy as _ # noqa
-
-from horizon import exceptions
-from horizon import forms
-from horizon import messages
-
-from openstack_dashboard import api
-from openstack_dashboard.api import cinder
-from openstack_dashboard.api import nova
-from openstack_dashboard.dashboards.project.instances import tables
-
-
-class CreateForm(forms.SelfHandlingForm):
- tenantP = forms.ChoiceField(label=_("Project"), required=True)
- name = forms.CharField(max_length="255", label=_("Server Group Name"))
- policy = forms.ChoiceField(label=_("Policy"),
- required=False,
- widget=forms.Select(
- attrs={
- 'class': 'switchable',
- 'data-slug': 'policy_ht'}))
-
- is_best_effort = forms.BooleanField(label=_("Best Effort"), required=False)
-
- group_size = forms.IntegerField(
- min_value=1,
- label=_("Max Group Size (Instances)"),
- required=False,
- widget=forms.TextInput(
- attrs={
- 'class': 'switchable switched',
- 'data-switch-on': 'policy_ht',
- 'data-policy_ht-anti-affinity': 'Max Group Size (Instances)',
- 'data-policy_ht-affinity': 'Max Group Size (Instances)'}))
-
- group_size_ht = forms.IntegerField(
- label=_("Max Group Size (Instances)"),
- required=False,
- widget=forms.TextInput(
- attrs={
- 'readonly': 'readonly',
- 'class': 'switchable switched',
- 'data-switch-on': 'policy_ht',
- 'data-policy_ht-affinity-hyperthread':
- 'Max Group Size (Instances)'}))
-
- def __init__(self, request, *args, **kwargs):
- super(CreateForm, self).__init__(request, *args, **kwargs)
- self.fields['policy'].choices = [("anti-affinity", "anti-affinity"),
- ("affinity", "affinity")]
-
- # Populate available project_id/name choices
- all_projects = []
- try:
- # Get list of available projects.
- all_projects, has_more = api.keystone.tenant_list(request)
-
- projects_list = [(project.id, project.name)
- for project in all_projects]
-
- except Exception:
- projects_list = []
- exceptions.handle(self.request,
- _('Unable to retrieve list of tenants.'))
-
- self.fields['tenantP'].choices = projects_list
-
- def handle(self, request, data):
- try:
- policy = data['policy']
- policies = []
- if policy:
- policies.append(policy)
- metadata = {}
- if data['is_best_effort']:
- metadata['wrs-sg:best_effort'] = "true"
- group_size = data['group_size']
- group_size_ht = data['group_size_ht']
- if group_size:
- metadata['wrs-sg:group_size'] = str(group_size)
- elif group_size_ht:
- metadata['wrs-sg:group_size'] = str(group_size_ht)
-
- kwargs = {'name': data['name'],
- 'policies': policies,
- 'metadata': metadata}
-
- server_group = nova.server_group_create(request, **kwargs)
- return server_group
-
- except ValidationError as e:
- self.api_error(e.messages[0])
- return False
- except Exception:
- exceptions.handle(request, ignore=True)
- self.api_error(_("Unable to create server group."))
- return False
-
-
-class AttachForm(forms.SelfHandlingForm):
- instance = forms.ChoiceField(label=_("Attach to Server Group"),
- help_text=_("Select an server group to "
- "attach to."))
- device = forms.CharField(label=_("Device Name"))
-
- def __init__(self, *args, **kwargs):
- super(AttachForm, self).__init__(*args, **kwargs)
-
- # Hide the device field if the hypervisor doesn't support it.
- hypervisor_features = getattr(settings,
- "OPENSTACK_HYPERVISOR_FEATURES", {})
- can_set_mount_point = hypervisor_features.get("can_set_mount_point",
- True)
- if not can_set_mount_point:
- self.fields['device'].widget = forms.widgets.HiddenInput()
- self.fields['device'].required = False
-
- # populate volume_id
- volume = kwargs.get('initial', {}).get("volume", None)
- if volume:
- volume_id = volume.id
- else:
- volume_id = None
- self.fields['volume_id'] = forms.CharField(widget=forms.HiddenInput(),
- initial=volume_id)
-
- # Populate instance choices
- instance_list = kwargs.get('initial', {}).get('instances', [])
- instances = []
- for instance in instance_list:
- if instance.status in tables.ACTIVE_STATES and \
- not any(instance.id == att["server_id"]
- for att in volume.attachments):
- instances.append((instance.id, '%s (%s)' % (instance.name,
- instance.id)))
- if instances:
- instances.insert(0, ("", _("Select an instance")))
- else:
- instances = (("", _("No instances available")),)
- self.fields['instance'].choices = instances
-
- def handle(self, request, data):
- instance_choices = dict(self.fields['instance'].choices)
- instance_name = instance_choices.get(data['instance'],
- _("Unknown instance (None)"))
- # The name of the instance in the choices list has the ID appended to
- # it, so let's slice that off...
- instance_name = instance_name.rsplit(" (")[0]
- try:
- attach = api.nova.instance_volume_attach(request,
- data['volume_id'],
- data['instance'],
- data.get('device', ''))
- volume = cinder.volume_get(request, data['volume_id'])
- if not volume.display_name:
- volume_name = volume.id
- else:
- volume_name = volume.display_name
- message = _('Attaching volume %(vol)s to instance '
- '%(inst)s on %(dev)s.') % {"vol": volume_name,
- "inst": instance_name,
- "dev": attach.device}
- messages.info(request, message)
- return True
- except Exception:
- redirect = reverse("horizon:project:volumes:index")
- exceptions.handle(request,
- _('Unable to attach volume.'),
- redirect=redirect)
+# 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.
+#
+# Copyright (c) 2013-2017 Wind River Systems, Inc.
+#
+# Copyright 2012 Nebula, Inc.
+# All rights reserved.
+
+"""
+Views for managing volumes.
+"""
+
+from django.conf import settings
+from django.core.urlresolvers import reverse
+from django.forms import ValidationError
+from django.utils.translation import ugettext_lazy as _ # noqa
+
+from horizon import exceptions
+from horizon import forms
+from horizon import messages
+
+from openstack_dashboard import api
+from openstack_dashboard.api import cinder
+from openstack_dashboard.api import nova
+from openstack_dashboard.dashboards.project.instances import tables
+
+
+class CreateForm(forms.SelfHandlingForm):
+ tenantP = forms.ChoiceField(label=_("Project"), required=True)
+ name = forms.CharField(max_length="255", label=_("Server Group Name"))
+ policy = forms.ChoiceField(label=_("Policy"),
+ required=False,
+ widget=forms.Select(
+ attrs={
+ 'class': 'switchable',
+ 'data-slug': 'policy_ht'}))
+
+ is_best_effort = forms.BooleanField(label=_("Best Effort"), required=False)
+
+ group_size = forms.IntegerField(
+ min_value=1,
+ label=_("Max Group Size (Instances)"),
+ required=False,
+ widget=forms.TextInput(
+ attrs={
+ 'class': 'switchable switched',
+ 'data-switch-on': 'policy_ht',
+ 'data-policy_ht-anti-affinity': 'Max Group Size (Instances)',
+ 'data-policy_ht-affinity': 'Max Group Size (Instances)'}))
+
+ group_size_ht = forms.IntegerField(
+ label=_("Max Group Size (Instances)"),
+ required=False,
+ widget=forms.TextInput(
+ attrs={
+ 'readonly': 'readonly',
+ 'class': 'switchable switched',
+ 'data-switch-on': 'policy_ht',
+ 'data-policy_ht-affinity-hyperthread':
+ 'Max Group Size (Instances)'}))
+
+ def __init__(self, request, *args, **kwargs):
+ super(CreateForm, self).__init__(request, *args, **kwargs)
+ self.fields['policy'].choices = [("anti-affinity", "anti-affinity"),
+ ("affinity", "affinity")]
+
+ # Populate available project_id/name choices
+ all_projects = []
+ try:
+ # Get list of available projects.
+ all_projects, has_more = api.keystone.tenant_list(request)
+
+ projects_list = [(project.id, project.name)
+ for project in all_projects]
+
+ except Exception:
+ projects_list = []
+ exceptions.handle(self.request,
+ _('Unable to retrieve list of tenants.'))
+
+ self.fields['tenantP'].choices = projects_list
+
+ def handle(self, request, data):
+ try:
+ policy = data['policy']
+ policies = []
+ if policy:
+ policies.append(policy)
+ metadata = {}
+ if data['is_best_effort']:
+ metadata['wrs-sg:best_effort'] = "true"
+ group_size = data['group_size']
+ group_size_ht = data['group_size_ht']
+ if group_size:
+ metadata['wrs-sg:group_size'] = str(group_size)
+ elif group_size_ht:
+ metadata['wrs-sg:group_size'] = str(group_size_ht)
+
+ project_id = None
+ if data['tenantP']:
+ project_id = data['tenantP']
+
+ server_group = nova.server_group_create(
+ request, data['name'], project_id, metadata, policies)
+ return server_group
+
+ except ValidationError as e:
+ self.api_error(e.messages[0])
+ return False
+ except Exception as e:
+ exceptions.handle(request, ignore=True)
+ self.api_error(_("Unable to create server group."))
+ return False
+
+
+class AttachForm(forms.SelfHandlingForm):
+ instance = forms.ChoiceField(label=_("Attach to Server Group"),
+ help_text=_("Select an server group to "
+ "attach to."))
+ device = forms.CharField(label=_("Device Name"))
+
+ def __init__(self, *args, **kwargs):
+ super(AttachForm, self).__init__(*args, **kwargs)
+
+ # Hide the device field if the hypervisor doesn't support it.
+ hypervisor_features = getattr(settings,
+ "OPENSTACK_HYPERVISOR_FEATURES", {})
+ can_set_mount_point = hypervisor_features.get("can_set_mount_point",
+ True)
+ if not can_set_mount_point:
+ self.fields['device'].widget = forms.widgets.HiddenInput()
+ self.fields['device'].required = False
+
+ # populate volume_id
+ volume = kwargs.get('initial', {}).get("volume", None)
+ if volume:
+ volume_id = volume.id
+ else:
+ volume_id = None
+ self.fields['volume_id'] = forms.CharField(widget=forms.HiddenInput(),
+ initial=volume_id)
+
+ # Populate instance choices
+ instance_list = kwargs.get('initial', {}).get('instances', [])
+ instances = []
+ for instance in instance_list:
+ if instance.status in tables.ACTIVE_STATES and \
+ not any(instance.id == att["server_id"]
+ for att in volume.attachments):
+ instances.append((instance.id, '%s (%s)' % (instance.name,
+ instance.id)))
+ if instances:
+ instances.insert(0, ("", _("Select an instance")))
+ else:
+ instances = (("", _("No instances available")),)
+ self.fields['instance'].choices = instances
+
+ def handle(self, request, data):
+ instance_choices = dict(self.fields['instance'].choices)
+ instance_name = instance_choices.get(data['instance'],
+ _("Unknown instance (None)"))
+ # The name of the instance in the choices list has the ID appended to
+ # it, so let's slice that off...
+ instance_name = instance_name.rsplit(" (")[0]
+ try:
+ attach = api.nova.instance_volume_attach(request,
+ data['volume_id'],
+ data['instance'],
+ data.get('device', ''))
+ volume = cinder.volume_get(request, data['volume_id'])
+ if not volume.display_name:
+ volume_name = volume.id
+ else:
+ volume_name = volume.display_name
+ message = _('Attaching volume %(vol)s to instance '
+ '%(inst)s on %(dev)s.') % {"vol": volume_name,
+ "inst": instance_name,
+ "dev": attach.device}
+ messages.info(request, message)
+ return True
+ except Exception:
+ redirect = reverse("horizon:project:volumes:index")
+ exceptions.handle(request,
+ _('Unable to attach volume.'),
+ redirect=redirect)
diff --git a/cgcs_dashboard/dashboards/admin/server_groups/panel.py b/starlingx_dashboard/dashboards/admin/server_groups/panel.py
similarity index 70%
rename from cgcs_dashboard/dashboards/admin/server_groups/panel.py
rename to starlingx_dashboard/dashboards/admin/server_groups/panel.py
index 43230d9e..66f4d15a 100755
--- a/cgcs_dashboard/dashboards/admin/server_groups/panel.py
+++ b/starlingx_dashboard/dashboards/admin/server_groups/panel.py
@@ -1,35 +1,40 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# 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.
-#
-# Copyright (c) 2013-2017 Wind River Systems, Inc.
-#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
-
-
-from django.utils.translation import ugettext_lazy as _
-
-import horizon
-
-
-class ServerGroups(horizon.Panel):
- name = _("Server Groups")
- slug = 'server_groups'
- # Server groups are wrs-specific
- permissions = ('openstack.services.compute',)
- policy_rules = (("compute", "context_is_admin"),)
+# 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.
+#
+# Copyright (c) 2013-2017 Wind River Systems, Inc.
+#
+
+from django.utils.translation import ugettext_lazy as _
+
+import horizon
+
+
+class ServerGroups(horizon.Panel):
+ name = _("Server Groups")
+ slug = 'server_groups'
+ # Server groups are wrs-specific
+ permissions = ('openstack.services.compute',)
+ policy_rules = (("compute", "context_is_admin"),)
+
+ def allowed(self, context):
+ if context['request'].user.services_region == 'SystemController':
+ return False
+ else:
+ return super(ServerGroups, self).allowed(context)
+
+ def nav(self, context):
+ if context['request'].user.services_region == 'SystemController':
+ return False
+ else:
+ return True
diff --git a/cgcs_dashboard/dashboards/admin/server_groups/tables.py b/starlingx_dashboard/dashboards/admin/server_groups/tables.py
similarity index 92%
rename from cgcs_dashboard/dashboards/admin/server_groups/tables.py
rename to starlingx_dashboard/dashboards/admin/server_groups/tables.py
index 04efdd41..e8205987 100755
--- a/cgcs_dashboard/dashboards/admin/server_groups/tables.py
+++ b/starlingx_dashboard/dashboards/admin/server_groups/tables.py
@@ -1,320 +1,305 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright 2014 Wind River, Inc.
-# 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.
-#
-# Copyright (c) 2013-2017 Wind River Systems, Inc.
-#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
-
-
-from django.core.urlresolvers import NoReverseMatch
-from django.core.urlresolvers import reverse
-from django.utils import html
-from django.utils import safestring
-from django.utils.translation import string_concat
-from django.utils.translation import ugettext_lazy as _ # noqa
-from django.utils.translation import ungettext_lazy
-
-from horizon import exceptions
-from horizon import tables
-
-from openstack_dashboard import api
-from openstack_dashboard.api import nova
-from openstack_dashboard.dashboards.project.volumes.tables \
- import get_attachment_name
-from openstack_dashboard.usage import quotas
-
-
-DELETABLE_STATES = ("available", "error")
-
-
-class DeleteServerGroup(tables.DeleteAction):
- data_type_singular = _("Server Group")
- data_type_plural = _("Server Groups")
- action_past = _("Scheduled deletion of")
-
- @staticmethod
- def action_present(count):
- return ungettext_lazy(
- u"Server Group",
- u"Server Groups",
- count
- )
-
- @staticmethod
- def action_past(count):
- return ungettext_lazy(
- u"Deleted Image",
- u"Deleted Images",
- count
- )
-
- def delete(self, request, obj_id):
- obj = self.table.get_object_by_id(obj_id)
- name = self.table.get_object_display(obj)
-
- try:
- nova.server_group_delete(request, obj_id)
- except Exception:
- msg = _('Unable to delete group "%s" because it is not empty. '
- 'Either delete the member instances'
- ' or remove them from the group.')
- exceptions.check_message(["group", "not", "empty."], msg % name)
- raise
-
- # maybe do a precheck to see if the group is empty first?
- def allowed(self, request, server_group=None):
- return True
-
-
-class CreateServerGroup(tables.LinkAction):
- name = "create"
- verbose_name = _("Create Server Group")
- url = "horizon:admin:server_groups:create"
- classes = ("ajax-modal", "btn-create")
- icon = "plus"
-
- def allowed(self, request, volume=None):
- usages = quotas.tenant_quota_usages(request)
- if usages['server_groups']['available'] <= 0:
- if "disabled" not in self.classes:
- self.classes = [c for c in self.classes] + ['disabled']
- self.verbose_name = string_concat(self.verbose_name, ' ',
- _("(Quota exceeded)"))
- else:
- self.verbose_name = _("Create Server Group")
- classes = [c for c in self.classes if c != "disabled"]
- self.classes = classes
- return True
-
-
-class EditAttachments(tables.LinkAction):
- name = "attachments"
- verbose_name = _("Edit Attachments")
- url = "horizon:admin:server_groups:attach"
- classes = ("ajax-modal", "btn-edit")
-
- def allowed(self, request, server_group=None):
- return True # volume.status in ("available", "in-use")
-
-
-class CreateSnapshot(tables.LinkAction):
- name = "snapshots"
- verbose_name = _("Create Snapshot")
- url = "horizon:admin:server_groups:create_snapshot"
- classes = ("ajax-modal", "btn-camera")
-
- def allowed(self, request, server_group=None):
- return True # server_group.status == "available"
-
-
-class UpdateRow(tables.Row):
- ajax = True
-
- def get_data(self, request, server_group_id):
- server_group = nova.server_group_get(request, server_group_id)
- if not server_group.name:
- server_group.name = server_group_id
-
- return server_group
-
-
-def get_policies(server_group):
- policies = ', '.join(server_group.policies)
- return policies
-
-
-def get_metadata(server_group):
- metadata_items = ['{}:{}'.format(x, y) for x, y in
- server_group.metadata.items()]
- metadata = ', '.join(metadata_items)
- return metadata
-
-
-def get_member_name(request, server_id):
- try:
- server = api.nova.server_get(request, server_id)
- name = server.name
- except Exception:
- name = None
- exceptions.handle(request, _("Unable to retrieve "
- "member information."))
- # try and get a URL
- try:
- url = reverse("horizon:admin:instances:detail", args=(server_id,))
- instance = '%s' % (url, html.escape(name))
- except NoReverseMatch:
- instance = name
- return instance
-
-
-class ProjectNameColumn(tables.Column):
- """Customized column class
-
- Customized column class that does complex processing on the
- server group.
- """
-
- def get_raw_data(self, server_group):
- request = self.table.request
- project_id = getattr(server_group, 'project_id', None)
- try:
- tenant = api.keystone.tenant_get(request,
- project_id,
- admin=True)
-
- project_name = getattr(tenant, "name", None)
- except Exception:
- project_name = "(not found)"
-
- return project_name
-
-
-class MemberColumn(tables.Column):
- """Customized column class
-
- Customized column class that does complex processing on the instances
- in a server group. This was substantially copied
- from the volume equivalent.
- """
-
- def get_raw_data(self, server_group):
- request = self.table.request
- link = _('%(name)s (%(id)s)')
- members = []
- for member in server_group.members:
- member_id = member
- name = get_member_name(request, member)
- vals = {"name": name, "id": member_id}
- members.append(link % vals)
- return safestring.mark_safe(", ".join(members))
-
-
-def get_server_group_type(server_group):
- return server_group.volume_type if server_group.volume_type != "None" \
- else None
-
-
-class ServerGroupsFilterAction(tables.FilterAction):
- def filter(self, table, server_groups, filter_string):
- """Naive case-insensitive search."""
- q = filter_string.lower()
- return [group for group in server_groups
- if q in group.display_name.lower()]
-
-
-class ServerGroupsTable(tables.DataTable):
- projectname = ProjectNameColumn("project_name",
- verbose_name=_("Project"))
- name = tables.Column("name",
- verbose_name=_("Group Name"),
- link="horizon:admin:server_groups:detail")
- policies = tables.Column(get_policies,
- verbose_name=_("Policies"))
- members = MemberColumn("members",
- verbose_name=_("Members"))
- metadata = tables.Column(get_metadata,
- verbose_name=_("Metadata"))
-
- class Meta(object):
- name = "server_groups"
- verbose_name = _("Server Groups")
- row_class = UpdateRow
- table_actions = (
- CreateServerGroup, DeleteServerGroup, ServerGroupsFilterAction)
- row_actions = (DeleteServerGroup,)
-
- def get_object_display(self, obj):
- return obj.name
-
-
-class DetachServerGroup(tables.BatchAction):
- name = "detach"
- action_present = _("Detach")
- action_past = _("Detaching") # This action is asynchronous.
- data_type_singular = _("Server Group")
- data_type_plural = _("Server Groups")
- action_type = 'danger'
-
- @staticmethod
- def action_present(count):
- return ungettext_lazy(
- u"Server Group",
- u"Server Groups",
- count
- )
-
- @staticmethod
- def action_past(count):
- return ungettext_lazy(
- u"Deleted Group",
- u"Deleted Groups",
- count
- )
-
- def action(self, request, obj_id):
- attachment = self.table.get_object_by_id(obj_id)
- api.nova.instance_server_group_detach(request,
- attachment.get('server_id',
- None),
- obj_id)
-
- def get_success_url(self, request):
- return reverse('horizon:admin:server_groups:index')
-
-
-class AttachedInstanceColumn(tables.Column):
- """Customized column class
-
- Customized column class that does complex processing on the attachments
- for a server group.
- """
-
- def get_raw_data(self, attachment):
- request = self.table.request
- return safestring.mark_safe(get_attachment_name(request, attachment,
- True))
-
-
-class AttachmentsTable(tables.DataTable):
- instance = AttachedInstanceColumn(get_member_name,
- verbose_name=_("Instance"))
- device = tables.Column("device",
- verbose_name=_("Device"))
-
- def get_object_id(self, obj):
- return obj['id']
-
- def get_object_display(self, attachment):
- instance_name = get_attachment_name(self.request, attachment, True)
- vals = {"dev": attachment['device'],
- "instance_name": html.strip_tags(instance_name)}
- return _("%(dev)s on instance %(instance_name)s") % vals
-
- def get_object_by_id(self, obj_id):
- for obj in self.data:
- if self.get_object_id(obj) == obj_id:
- return obj
- raise ValueError('No match found for the id "%s".' % obj_id)
-
- class Meta(object):
- name = "attachments"
- verbose_name = _("Attachments")
- table_actions = (DetachServerGroup,)
- row_actions = (DetachServerGroup,)
+# Copyright 2014 Wind River, Inc.
+# 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.
+#
+# Copyright (c) 2013-2017 Wind River Systems, Inc.
+#
+
+from django.core.urlresolvers import NoReverseMatch
+from django.core.urlresolvers import reverse
+from django.utils import html
+from django.utils import safestring
+from django.utils.translation import string_concat
+from django.utils.translation import ugettext_lazy as _ # noqa
+from django.utils.translation import ungettext_lazy
+
+from horizon import exceptions
+from horizon import tables
+
+from openstack_dashboard import api
+from openstack_dashboard.api import nova
+from openstack_dashboard.dashboards.project.volumes.tables \
+ import get_attachment_name
+from openstack_dashboard.usage import quotas
+
+
+DELETABLE_STATES = ("available", "error")
+
+
+class DeleteServerGroup(tables.DeleteAction):
+ @staticmethod
+ def action_present(count):
+ return ungettext_lazy(
+ u"Delete Server Group",
+ u"Delete Server Groups",
+ count
+ )
+
+ @staticmethod
+ def action_past(count):
+ return ungettext_lazy(
+ u"Deleted Server Group",
+ u"Deleted Server Groups",
+ count
+ )
+
+ def delete(self, request, obj_id):
+ obj = self.table.get_object_by_id(obj_id)
+ name = self.table.get_object_display(obj)
+
+ try:
+ nova.server_group_delete(request, obj_id)
+ except Exception:
+ msg = _('Unable to delete group "%s" because it is not empty. '
+ 'Either delete the member instances'
+ ' or remove them from the group.')
+ exceptions.check_message(["group", "not", "empty."], msg % name)
+ raise
+
+ # maybe do a precheck to see if the group is empty first?
+ def allowed(self, request, server_group=None):
+ return True
+
+
+class CreateServerGroup(tables.LinkAction):
+ name = "create"
+ verbose_name = _("Create Server Group")
+ url = "horizon:admin:server_groups:create"
+ classes = ("ajax-modal", "btn-create")
+ icon = "plus"
+
+ def allowed(self, request, volume=None):
+ usages = quotas.tenant_quota_usages(request)
+ if usages['server_groups']['available'] <= 0:
+ if "disabled" not in self.classes:
+ self.classes = [c for c in self.classes] + ['disabled']
+ self.verbose_name = string_concat(self.verbose_name, ' ',
+ _("(Quota exceeded)"))
+ else:
+ self.verbose_name = _("Create Server Group")
+ classes = [c for c in self.classes if c != "disabled"]
+ self.classes = classes
+ return True
+
+
+class EditAttachments(tables.LinkAction):
+ name = "attachments"
+ verbose_name = _("Edit Attachments")
+ url = "horizon:admin:server_groups:attach"
+ classes = ("ajax-modal", "btn-edit")
+
+ def allowed(self, request, server_group=None):
+ return True # volume.status in ("available", "in-use")
+
+
+class CreateSnapshot(tables.LinkAction):
+ name = "snapshots"
+ verbose_name = _("Create Snapshot")
+ url = "horizon:admin:server_groups:create_snapshot"
+ classes = ("ajax-modal", "btn-camera")
+
+ def allowed(self, request, server_group=None):
+ return True # server_group.status == "available"
+
+
+class UpdateRow(tables.Row):
+ ajax = True
+
+ def get_data(self, request, server_group_id):
+ server_group = nova.server_group_get(request, server_group_id)
+ if not server_group.name:
+ server_group.name = server_group_id
+
+ return server_group
+
+
+def get_policies(server_group):
+ policies = ', '.join(server_group.policies)
+ return policies
+
+
+def get_metadata(server_group):
+ metadata_items = ['{}:{}'.format(x, y) for x, y in
+ server_group.metadata.items()]
+ metadata = ', '.join(metadata_items)
+ return metadata
+
+
+def get_member_name(request, server_id):
+ try:
+ server = api.nova.server_get(request, server_id)
+ name = server.name
+ except Exception:
+ name = None
+ exceptions.handle(request, _("Unable to retrieve "
+ "member information."))
+ # try and get a URL
+ try:
+ url = reverse("horizon:admin:instances:detail", args=(server_id,))
+ instance = '%s' % (url, html.escape(name))
+ except NoReverseMatch:
+ instance = name
+ return instance
+
+
+class ProjectNameColumn(tables.Column):
+ """Customized column class
+
+ Customized column class that does complex processing on the
+ server group.
+ """
+
+ def get_raw_data(self, server_group):
+ request = self.table.request
+ project_id = getattr(server_group, 'project_id', None)
+ try:
+ tenant = api.keystone.tenant_get(request,
+ project_id,
+ admin=True)
+
+ project_name = getattr(tenant, "name", None)
+ except Exception:
+ project_name = "(not found)"
+
+ return project_name
+
+
+class MemberColumn(tables.Column):
+ """Customized column class
+
+ Customized column class that does complex processing on the instances
+ in a server group. This was substantially copied
+ from the volume equivalent.
+ """
+
+ def get_raw_data(self, server_group):
+ request = self.table.request
+ link = _('%(name)s (%(id)s)')
+ members = []
+ for member in server_group.members:
+ member_id = member
+ name = get_member_name(request, member)
+ vals = {"name": name, "id": member_id}
+ members.append(link % vals)
+ return safestring.mark_safe(", ".join(members))
+
+
+def get_server_group_type(server_group):
+ return server_group.volume_type if server_group.volume_type != "None" \
+ else None
+
+
+class ServerGroupsFilterAction(tables.FilterAction):
+ def filter(self, table, server_groups, filter_string):
+ """Naive case-insensitive search."""
+ q = filter_string.lower()
+ return [group for group in server_groups
+ if q in group.display_name.lower()]
+
+
+class ServerGroupsTable(tables.DataTable):
+ projectname = ProjectNameColumn("project_name",
+ verbose_name=_("Project"))
+ name = tables.Column("name",
+ verbose_name=_("Group Name"),
+ link="horizon:admin:server_groups:detail")
+ policies = tables.Column(get_policies,
+ verbose_name=_("Policies"))
+ members = MemberColumn("members",
+ verbose_name=_("Members"))
+ metadata = tables.Column(get_metadata,
+ verbose_name=_("Metadata"))
+
+ class Meta(object):
+ name = "server_groups"
+ verbose_name = _("Server Groups")
+ row_class = UpdateRow
+ table_actions = (
+ CreateServerGroup, DeleteServerGroup, ServerGroupsFilterAction)
+ row_actions = (DeleteServerGroup,)
+
+ def get_object_display(self, obj):
+ return obj.name
+
+
+class DetachServerGroup(tables.BatchAction):
+ name = "detach"
+ action_type = 'danger'
+
+ @staticmethod
+ def action_present(count):
+ return ungettext_lazy(
+ u"Detach Server Group",
+ u"Detached Server Groups",
+ count
+ )
+
+ @staticmethod
+ def action_past(count):
+ return ungettext_lazy(
+ u"Detaching Server Group",
+ u"Detaching Server Groups",
+ count
+ )
+
+ def action(self, request, obj_id):
+ attachment = self.table.get_object_by_id(obj_id)
+ api.nova.instance_server_group_detach(request,
+ attachment.get('server_id',
+ None),
+ obj_id)
+
+ def get_success_url(self, request):
+ return reverse('horizon:admin:server_groups:index')
+
+
+class AttachedInstanceColumn(tables.Column):
+ """Customized column class
+
+ Customized column class that does complex processing on the attachments
+ for a server group.
+ """
+
+ def get_raw_data(self, attachment):
+ request = self.table.request
+ return safestring.mark_safe(get_attachment_name(request, attachment,
+ True))
+
+
+class AttachmentsTable(tables.DataTable):
+ instance = AttachedInstanceColumn(get_member_name,
+ verbose_name=_("Instance"))
+ device = tables.Column("device",
+ verbose_name=_("Device"))
+
+ def get_object_id(self, obj):
+ return obj['id']
+
+ def get_object_display(self, attachment):
+ instance_name = get_attachment_name(self.request, attachment, True)
+ vals = {"dev": attachment['device'],
+ "instance_name": html.strip_tags(instance_name)}
+ return _("%(dev)s on instance %(instance_name)s") % vals
+
+ def get_object_by_id(self, obj_id):
+ for obj in self.data:
+ if self.get_object_id(obj) == obj_id:
+ return obj
+ raise ValueError('No match found for the id "%s".' % obj_id)
+
+ class Meta(object):
+ name = "attachments"
+ verbose_name = _("Attachments")
+ table_actions = (DetachServerGroup,)
+ row_actions = (DetachServerGroup,)
diff --git a/cgcs_dashboard/dashboards/admin/server_groups/tabs.py b/starlingx_dashboard/dashboards/admin/server_groups/tabs.py
similarity index 89%
rename from cgcs_dashboard/dashboards/admin/server_groups/tabs.py
rename to starlingx_dashboard/dashboards/admin/server_groups/tabs.py
index 0c51bf64..6d2bf6ae 100755
--- a/cgcs_dashboard/dashboards/admin/server_groups/tabs.py
+++ b/starlingx_dashboard/dashboards/admin/server_groups/tabs.py
@@ -1,58 +1,51 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# 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.
-#
-# Copyright (c) 2013-2017 Wind River Systems, Inc.
-#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
-
-
-from django.core.urlresolvers import reverse
-from django.utils.translation import ugettext_lazy as _ # noqa
-
-from horizon import exceptions
-from horizon import tabs
-
-from openstack_dashboard.api import nova
-
-
-class OverviewTab(tabs.Tab):
- name = _("Overview")
- slug = "overview"
- template_name = ("admin/server_groups/"
- "_detail_overview.html")
-
- def get_context_data(self, request):
- server_group_id = self.tab_group.kwargs['server_group_id']
- try:
- server_group = nova.server_group_get(request, server_group_id)
- server_group.members_display = []
- for member in server_group.members:
- server_group.members_display.append(
- dict(id=member, instance=nova.server_get(request, member)))
- except Exception:
- redirect = reverse('horizon:admin:server_groups:index')
- exceptions.handle(self.request,
- _('Unable to retrieve server group details.'),
- redirect=redirect)
- return {'server_group': server_group}
-
-
-class ServerGroupDetailTabs(tabs.TabGroup):
- slug = "server_group_details"
- tabs = (OverviewTab,)
+# 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.
+#
+# Copyright (c) 2013-2017 Wind River Systems, Inc.
+#
+
+from django.core.urlresolvers import reverse
+from django.utils.translation import ugettext_lazy as _ # noqa
+
+from horizon import exceptions
+from horizon import tabs
+
+from openstack_dashboard.api import nova
+
+
+class OverviewTab(tabs.Tab):
+ name = _("Overview")
+ slug = "overview"
+ template_name = ("admin/server_groups/"
+ "_detail_overview.html")
+
+ def get_context_data(self, request):
+ server_group_id = self.tab_group.kwargs['server_group_id']
+ try:
+ server_group = nova.server_group_get(request, server_group_id)
+ server_group.members_display = []
+ for member in server_group.members:
+ server_group.members_display.append(
+ dict(id=member, instance=nova.server_get(request, member)))
+ except Exception:
+ redirect = reverse('horizon:admin:server_groups:index')
+ exceptions.handle(self.request,
+ _('Unable to retrieve server group details.'),
+ redirect=redirect)
+ return {'server_group': server_group}
+
+
+class ServerGroupDetailTabs(tabs.TabGroup):
+ slug = "server_group_details"
+ tabs = (OverviewTab,)
diff --git a/cgcs_dashboard/dashboards/admin/server_groups/templates/server_groups/_attach.html b/starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/_attach.html
similarity index 97%
rename from cgcs_dashboard/dashboards/admin/server_groups/templates/server_groups/_attach.html
rename to starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/_attach.html
index 462f0ee8..2d04307a 100755
--- a/cgcs_dashboard/dashboards/admin/server_groups/templates/server_groups/_attach.html
+++ b/starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/_attach.html
@@ -1,26 +1,26 @@
-{% extends "horizon/common/_modal_form.html" %}
-{% load i18n %}
-{% load url from future %}
-
-{% block form_id %}attach_volume_form{% endblock %}
-{% block form_action %}{% url 'horizon:project:volumes:attach' volume.id %}{% endblock %}
-{% block form_class %}{{ block.super }} horizontal {% if show_attach %}split_half{% else %} no_split{% endif %}{% endblock %}
-
-{% block modal_id %}attach_volume_modal{% endblock %}
-{% block modal-header %}{% trans "Manage Volume Attachments" %}{% endblock %}
-
-{% block modal-body %}
- {% if show_attach %}
-
+ {% for key, value in server_group.metadata.items %}
+
{{ key }}
+
{{ value }}
+ {% endfor %}
+
+
diff --git a/cgcs_dashboard/dashboards/admin/server_groups/templates/server_groups/attach.html b/starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/attach.html
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/server_groups/templates/server_groups/attach.html
rename to starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/attach.html
index 4b4dad86..697273f4 100755
--- a/cgcs_dashboard/dashboards/admin/server_groups/templates/server_groups/attach.html
+++ b/starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/attach.html
@@ -1,11 +1,11 @@
-{% extends 'base.html' %}
-{% load i18n %}
-{% block title %}{% trans "Manage Volume Attachments" %}{% endblock %}
-
-{% block page_header %}
- {% include "horizon/common/_page_header.html" with title=_("Manage Volume Attachments") %}
-{% endblock page_header %}
-
-{% block main %}
- {% include 'project/volumes/_attach.html' %}
-{% endblock %}
+{% extends 'base.html' %}
+{% load i18n %}
+{% block title %}{% trans "Manage Volume Attachments" %}{% endblock %}
+
+{% block page_header %}
+ {% include "horizon/common/_page_header.html" with title=_("Manage Volume Attachments") %}
+{% endblock page_header %}
+
+{% block main %}
+ {% include 'project/volumes/_attach.html' %}
+{% endblock %}
diff --git a/cgcs_dashboard/dashboards/admin/server_groups/templates/server_groups/create.html b/starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/create.html
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/server_groups/templates/server_groups/create.html
rename to starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/create.html
index 39b7d120..dc814115 100755
--- a/cgcs_dashboard/dashboards/admin/server_groups/templates/server_groups/create.html
+++ b/starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/create.html
@@ -1,11 +1,11 @@
-{% extends 'base.html' %}
-{% load i18n %}
-{% block title %}{% trans "Create Server Group" %}{% endblock %}
-
-{% block page_header %}
- {% include "horizon/common/_page_header.html" with title=_("Create a Server Group") %}
-{% endblock page_header %}
-
-{% block main %}
- {% include 'project/server_groups/_create.html' %}
-{% endblock %}
+{% extends 'base.html' %}
+{% load i18n %}
+{% block title %}{% trans "Create Server Group" %}{% endblock %}
+
+{% block page_header %}
+ {% include "horizon/common/_page_header.html" with title=_("Create a Server Group") %}
+{% endblock page_header %}
+
+{% block main %}
+ {% include 'project/server_groups/_create.html' %}
+{% endblock %}
diff --git a/cgcs_dashboard/dashboards/project/server_groups/templates/server_groups/detail.html b/starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/detail.html
similarity index 95%
rename from cgcs_dashboard/dashboards/project/server_groups/templates/server_groups/detail.html
rename to starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/detail.html
index 3ce02ba3..dcd744f6 100755
--- a/cgcs_dashboard/dashboards/project/server_groups/templates/server_groups/detail.html
+++ b/starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/detail.html
@@ -1,11 +1,11 @@
-{% extends 'base.html' %}
-{% load i18n breadcrumb_nav %}
-{% block title %}{% trans "Server Group Details" %}{% endblock %}
-
-{% block main %}
-
-
- {{ tab_group.render }}
-
-
-{% endblock %}
+{% extends 'base.html' %}
+{% load i18n breadcrumb_nav %}
+{% block title %}{% trans "Server Group Details" %}{% endblock %}
+
+{% block main %}
+
+
+ {{ tab_group.render }}
+
+
+{% endblock %}
diff --git a/cgcs_dashboard/dashboards/admin/server_groups/templates/server_groups/index.html b/starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/index.html
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/server_groups/templates/server_groups/index.html
rename to starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/index.html
index 44a03e4c..98978ef2 100755
--- a/cgcs_dashboard/dashboards/admin/server_groups/templates/server_groups/index.html
+++ b/starlingx_dashboard/dashboards/admin/server_groups/templates/server_groups/index.html
@@ -1,11 +1,11 @@
-{% extends 'base.html' %}
-{% load i18n %}
-{% block title %}{% trans "Server Groups" %}{% endblock %}
-
-{% block page_header %}
- {% include "horizon/common/_page_header.html" with title=_("Server Groups") %}
-{% endblock page_header %}
-
-{% block main %}
- {{ table.render }}
-{% endblock %}
+{% extends 'base.html' %}
+{% load i18n %}
+{% block title %}{% trans "Server Groups" %}{% endblock %}
+
+{% block page_header %}
+ {% include "horizon/common/_page_header.html" with title=_("Server Groups") %}
+{% endblock page_header %}
+
+{% block main %}
+ {{ table.render }}
+{% endblock %}
diff --git a/cgcs_dashboard/dashboards/admin/server_groups/urls.py b/starlingx_dashboard/dashboards/admin/server_groups/urls.py
similarity index 83%
rename from cgcs_dashboard/dashboards/admin/server_groups/urls.py
rename to starlingx_dashboard/dashboards/admin/server_groups/urls.py
index 5df47c0a..90d2c780 100755
--- a/cgcs_dashboard/dashboards/admin/server_groups/urls.py
+++ b/starlingx_dashboard/dashboards/admin/server_groups/urls.py
@@ -1,39 +1,32 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# 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.
-#
-# Copyright (c) 2013-2017 Wind River Systems, Inc.
-#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
-
-
-from django.conf.urls import url
-
-from openstack_dashboard.dashboards.admin.server_groups import views
-
-
-urlpatterns = [
- url(r'^$', views.IndexView.as_view(), name='index'),
- url(r'^create/$', views.CreateView.as_view(), name='create'),
- url(r'^(?P[^/]+)/attach/$',
- views.EditAttachmentsView.as_view(),
- name='attach'),
- url(r'^(?P[^/]+)/$',
- views.DetailView.as_view(),
- name='detail')
-]
+# 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.
+#
+# Copyright (c) 2013-2017 Wind River Systems, Inc.
+#
+
+from django.conf.urls import url
+
+from openstack_dashboard.dashboards.admin.server_groups import views
+
+
+urlpatterns = [
+ url(r'^$', views.IndexView.as_view(), name='index'),
+ url(r'^create/$', views.CreateView.as_view(), name='create'),
+ url(r'^(?P[^/]+)/attach/$',
+ views.EditAttachmentsView.as_view(),
+ name='attach'),
+ url(r'^(?P[^/]+)/$',
+ views.DetailView.as_view(),
+ name='detail')
+]
diff --git a/cgcs_dashboard/dashboards/admin/server_groups/views.py b/starlingx_dashboard/dashboards/admin/server_groups/views.py
similarity index 95%
rename from cgcs_dashboard/dashboards/admin/server_groups/views.py
rename to starlingx_dashboard/dashboards/admin/server_groups/views.py
index e68dcc58..c8850aa9 100755
--- a/cgcs_dashboard/dashboards/admin/server_groups/views.py
+++ b/starlingx_dashboard/dashboards/admin/server_groups/views.py
@@ -1,154 +1,147 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# 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.
-#
-# Copyright (c) 2013-2017 Wind River Systems, Inc.
-#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
-#
-
-
-"""
-Views for managing server groups.
-"""
-
-from django.core.urlresolvers import 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 import tabs
-
-from openstack_dashboard import api
-from openstack_dashboard.usage import quotas
-
-from openstack_dashboard.dashboards.admin.server_groups \
- import forms as admin_forms
-
-from openstack_dashboard.dashboards.admin.server_groups \
- import tables as admin_tables
-from openstack_dashboard.dashboards.admin.server_groups \
- import tabs as admin_tabs
-
-
-# server groups don't currently support pagination
-class IndexView(tables.DataTableView):
- table_class = admin_tables.ServerGroupsTable
- template_name = 'admin/server_groups/index.html'
- page_title = _("Server Groups")
-
- def get_data(self):
- try:
- server_groups = api.nova.server_group_list(
- self.request)
- except Exception:
- server_groups = []
- exceptions.handle(self.request,
- _('Unable to retrieve server groups.'))
- return server_groups
-
-
-class DetailView(tabs.TabView):
- tab_group_class = admin_tabs.ServerGroupDetailTabs
- template_name = 'admin/server_groups/detail.html'
- page_title = 'Server Group Details'
-
-
-class CreateView(forms.ModalFormView):
- form_class = admin_forms.CreateForm
- template_name = 'admin/server_groups/create.html'
- success_url = reverse_lazy("horizon:admin:server_groups:index")
-
- def get_context_data(self, **kwargs):
- context = super(CreateView, self).get_context_data(**kwargs)
- try:
- context['usages'] = quotas.tenant_limit_usages(self.request)
- except Exception:
- exceptions.handle(self.request)
- return context
-
-
-class EditAttachmentsView(tables.DataTableView, forms.ModalFormView):
- table_class = admin_tables.AttachmentsTable
- form_class = admin_forms.AttachForm
- template_name = 'admin/server_groups/attach.html'
- success_url = reverse_lazy("horizon:admin:server_groups:index")
-
- def get_object(self):
- if not hasattr(self, "_object"):
- volume_id = self.kwargs['volume_id']
- try:
- self._object = api.cinder.volume_get(self.request, volume_id)
- except Exception:
- self._object = None
- exceptions.handle(self.request,
- _('Unable to retrieve volume information.'))
- return self._object
-
- def get_data(self):
- try:
- volumes = self.get_object()
- attachments = [att for att in volumes.attachments if att]
- except Exception:
- attachments = []
- exceptions.handle(self.request,
- _('Unable to retrieve volume information.'))
- return attachments
-
- def get_initial(self):
- try:
- instances, has_more = api.nova.server_list(self.request)
- except Exception:
- instances = []
- exceptions.handle(self.request,
- _("Unable to retrieve attachment information."))
- return {'volume': self.get_object(),
- 'instances': instances}
-
- def get_form(self):
- if not hasattr(self, "_form"):
- form_class = self.get_form_class()
- self._form = super(EditAttachmentsView, self).get_form(form_class)
- return self._form
-
- def get_context_data(self, **kwargs):
- context = super(EditAttachmentsView, self).get_context_data(**kwargs)
- context['form'] = self.get_form()
- volume = self.get_object()
- if volume and volume.status == 'available':
- context['show_attach'] = True
- else:
- context['show_attach'] = False
- context['volume'] = volume
- if self.request.is_ajax():
- context['hide'] = True
- return context
-
- def get(self, request, *args, **kwargs):
- # Table action handling
- handled = self.construct_tables()
- if handled:
- return handled
- return self.render_to_response(self.get_context_data(**kwargs))
-
- def post(self, request, *args, **kwargs):
- form = self.get_form()
- if form.is_valid():
- return self.form_valid(form)
- else:
- return self.get(request, *args, **kwargs)
+# 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.
+#
+# Copyright (c) 2013-2017 Wind River Systems, Inc.
+#
+
+"""
+Views for managing server groups.
+"""
+
+from django.core.urlresolvers import 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 import tabs
+
+from openstack_dashboard import api
+from openstack_dashboard.usage import quotas
+
+from openstack_dashboard.dashboards.admin.server_groups \
+ import forms as admin_forms
+
+from openstack_dashboard.dashboards.admin.server_groups \
+ import tables as admin_tables
+from openstack_dashboard.dashboards.admin.server_groups \
+ import tabs as admin_tabs
+
+
+# server groups don't currently support pagination
+class IndexView(tables.DataTableView):
+ table_class = admin_tables.ServerGroupsTable
+ template_name = 'admin/server_groups/index.html'
+ page_title = _("Server Groups")
+
+ def get_data(self):
+ try:
+ server_groups = api.nova.server_group_list(
+ self.request, all_projects=True)
+ except Exception:
+ server_groups = []
+ exceptions.handle(self.request,
+ _('Unable to retrieve server groups.'))
+ return server_groups
+
+
+class DetailView(tabs.TabView):
+ tab_group_class = admin_tabs.ServerGroupDetailTabs
+ template_name = 'admin/server_groups/detail.html'
+ page_title = 'Server Group Details'
+
+
+class CreateView(forms.ModalFormView):
+ form_class = admin_forms.CreateForm
+ template_name = 'admin/server_groups/create.html'
+ success_url = reverse_lazy("horizon:admin:server_groups:index")
+
+ def get_context_data(self, **kwargs):
+ context = super(CreateView, self).get_context_data(**kwargs)
+ try:
+ context['usages'] = quotas.tenant_limit_usages(self.request)
+ except Exception:
+ exceptions.handle(self.request)
+ return context
+
+
+class EditAttachmentsView(tables.DataTableView, forms.ModalFormView):
+ table_class = admin_tables.AttachmentsTable
+ form_class = admin_forms.AttachForm
+ template_name = 'admin/server_groups/attach.html'
+ success_url = reverse_lazy("horizon:admin:server_groups:index")
+
+ def get_object(self):
+ if not hasattr(self, "_object"):
+ volume_id = self.kwargs['volume_id']
+ try:
+ self._object = api.cinder.volume_get(self.request, volume_id)
+ except Exception:
+ self._object = None
+ exceptions.handle(self.request,
+ _('Unable to retrieve volume information.'))
+ return self._object
+
+ def get_data(self):
+ try:
+ volumes = self.get_object()
+ attachments = [att for att in volumes.attachments if att]
+ except Exception:
+ attachments = []
+ exceptions.handle(self.request,
+ _('Unable to retrieve volume information.'))
+ return attachments
+
+ def get_initial(self):
+ try:
+ instances, has_more = api.nova.server_list(self.request)
+ except Exception:
+ instances = []
+ exceptions.handle(self.request,
+ _("Unable to retrieve attachment information."))
+ return {'volume': self.get_object(),
+ 'instances': instances}
+
+ def get_form(self):
+ if not hasattr(self, "_form"):
+ form_class = self.get_form_class()
+ self._form = super(EditAttachmentsView, self).get_form(form_class)
+ return self._form
+
+ def get_context_data(self, **kwargs):
+ context = super(EditAttachmentsView, self).get_context_data(**kwargs)
+ context['form'] = self.get_form()
+ volume = self.get_object()
+ if volume and volume.status == 'available':
+ context['show_attach'] = True
+ else:
+ context['show_attach'] = False
+ context['volume'] = volume
+ if self.request.is_ajax():
+ context['hide'] = True
+ return context
+
+ def get(self, request, *args, **kwargs):
+ # Table action handling
+ handled = self.construct_tables()
+ if handled:
+ return handled
+ return self.render_to_response(self.get_context_data(**kwargs))
+
+ def post(self, request, *args, **kwargs):
+ form = self.get_form()
+ if form.is_valid():
+ return self.form_valid(form)
+ else:
+ return self.get(request, *args, **kwargs)
diff --git a/cgcs_dashboard/dashboards/admin/software_management/__init__.py b/starlingx_dashboard/dashboards/admin/software_management/__init__.py
similarity index 100%
rename from cgcs_dashboard/dashboards/admin/software_management/__init__.py
rename to starlingx_dashboard/dashboards/admin/software_management/__init__.py
diff --git a/cgcs_dashboard/dashboards/admin/software_management/forms.py b/starlingx_dashboard/dashboards/admin/software_management/forms.py
similarity index 88%
rename from cgcs_dashboard/dashboards/admin/software_management/forms.py
rename to starlingx_dashboard/dashboards/admin/software_management/forms.py
index 448a43c9..60a87dbf 100755
--- a/cgcs_dashboard/dashboards/admin/software_management/forms.py
+++ b/starlingx_dashboard/dashboards/admin/software_management/forms.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
import logging
@@ -14,7 +12,7 @@ from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import messages
-from openstack_dashboard import api
+from starlingx_dashboard import api as stx_api
LOG = logging.getLogger(__name__)
@@ -41,7 +39,7 @@ class UploadPatchForm(forms.SelfHandlingForm):
for f in request.FILES.getlist('patch_files'):
try:
success_responses.append(
- api.patch.upload_patch(request, f, f.name))
+ stx_api.patch.upload_patch(request, f, f.name))
except Exception as ex:
failure_responses.append(str(ex))
@@ -125,10 +123,10 @@ class CreatePatchStrategyForm(forms.SelfHandlingForm):
label=_("Maximum Parallel Compute Hosts"),
initial=2,
min_value=2,
- max_value=10,
+ max_value=100,
required=True,
error_messages={'invalid': _('Maximum Parallel Compute Hosts must be '
- 'between 2 and 10.')},
+ 'between 2 and 100.')},
widget=forms.TextInput(
attrs={
'class': 'switched',
@@ -151,16 +149,16 @@ class CreatePatchStrategyForm(forms.SelfHandlingForm):
def __init__(self, request, *args, **kwargs):
super(CreatePatchStrategyForm, self).__init__(request, *args, **kwargs)
- cinder_backend = api.sysinv.get_cinder_backend(request)
- if api.sysinv.CINDER_BACKEND_CEPH not in cinder_backend:
+ cinder_backend = stx_api.sysinv.get_cinder_backend(request)
+ if stx_api.sysinv.CINDER_BACKEND_CEPH not in cinder_backend:
del self.fields['storage_apply_type']
- system_type = api.sysinv.get_system_type(request)
- if system_type == api.sysinv.SYSTEM_TYPE_AIO:
+ system_type = stx_api.sysinv.get_system_type(request)
+ if system_type == stx_api.sysinv.SYSTEM_TYPE_AIO:
del self.fields['controller_apply_type']
self.fields['compute_apply_type'].choices = self.AIO_APPLY_TYPES
- if api.sysinv.is_system_mode_simplex(request):
+ if stx_api.sysinv.is_system_mode_simplex(request):
self.fields['default_instance_action'].choices = \
self.SIMPLEX_INSTANCE_ACTIONS
@@ -170,8 +168,8 @@ class CreatePatchStrategyForm(forms.SelfHandlingForm):
def handle(self, request, data):
try:
- response = api.vim.create_strategy(
- request, api.vim.STRATEGY_SW_PATCH,
+ response = stx_api.vim.create_strategy(
+ request, stx_api.vim.STRATEGY_SW_PATCH,
data.get('controller_apply_type', 'ignore'),
data.get('storage_apply_type', 'ignore'), 'ignore',
data['compute_apply_type'],
@@ -240,8 +238,8 @@ class CreateUpgradeStrategyForm(forms.SelfHandlingForm):
def __init__(self, request, *args, **kwargs):
super(CreateUpgradeStrategyForm, self).__init__(request, *args,
**kwargs)
- cinder_backend = api.sysinv.get_cinder_backend(request)
- if api.sysinv.CINDER_BACKEND_CEPH not in cinder_backend:
+ cinder_backend = stx_api.sysinv.get_cinder_backend(request)
+ if stx_api.sysinv.CINDER_BACKEND_CEPH not in cinder_backend:
del self.fields['storage_apply_type']
def clean(self):
@@ -250,8 +248,8 @@ class CreateUpgradeStrategyForm(forms.SelfHandlingForm):
def handle(self, request, data):
try:
- response = api.vim.create_strategy(
- request, api.vim.STRATEGY_SW_UPGRADE, 'ignore',
+ response = stx_api.vim.create_strategy(
+ request, stx_api.vim.STRATEGY_SW_UPGRADE, 'ignore',
data.get('storage_apply_type', 'ignore'), 'ignore',
data['compute_apply_type'],
data['max_parallel_compute_hosts'],
diff --git a/cgcs_dashboard/dashboards/admin/software_management/panel.py b/starlingx_dashboard/dashboards/admin/software_management/panel.py
similarity index 82%
rename from cgcs_dashboard/dashboards/admin/software_management/panel.py
rename to starlingx_dashboard/dashboards/admin/software_management/panel.py
index 59db8258..e1c533e9 100755
--- a/cgcs_dashboard/dashboards/admin/software_management/panel.py
+++ b/starlingx_dashboard/dashboards/admin/software_management/panel.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
from django.utils.translation import ugettext_lazy as _
diff --git a/cgcs_dashboard/dashboards/admin/software_management/tables.py b/starlingx_dashboard/dashboards/admin/software_management/tables.py
similarity index 91%
rename from cgcs_dashboard/dashboards/admin/software_management/tables.py
rename to starlingx_dashboard/dashboards/admin/software_management/tables.py
index e6577543..f374d4ec 100755
--- a/cgcs_dashboard/dashboards/admin/software_management/tables.py
+++ b/starlingx_dashboard/dashboards/admin/software_management/tables.py
@@ -1,9 +1,7 @@
#
# Copyright (c) 2013-2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
import datetime
@@ -16,7 +14,7 @@ from django.utils.translation import ungettext_lazy
from horizon import messages
from horizon import tables
-from openstack_dashboard import api
+from starlingx_dashboard import api as stx_api
LOG = logging.getLogger(__name__)
@@ -56,7 +54,7 @@ class ApplyPatch(tables.BatchAction):
def handle(self, table, request, obj_ids):
try:
- result = api.patch.patch_apply_req(request, obj_ids)
+ result = stx_api.patch.patch_apply_req(request, obj_ids)
messages.success(request, result)
except Exception as ex:
messages.error(request, ex.message)
@@ -96,7 +94,7 @@ class RemovePatch(tables.BatchAction):
def handle(self, table, request, obj_ids):
try:
- result = api.patch.patch_remove_req(request, obj_ids)
+ result = stx_api.patch.patch_remove_req(request, obj_ids)
messages.success(request, result)
except Exception as ex:
messages.error(request, ex.message)
@@ -130,7 +128,7 @@ class DeletePatch(tables.BatchAction):
def handle(self, table, request, obj_ids):
try:
- result = api.patch.patch_delete_req(request, obj_ids)
+ result = stx_api.patch.patch_delete_req(request, obj_ids)
messages.success(request, result)
except Exception as ex:
messages.error(request, ex.message)
@@ -140,7 +138,7 @@ class UpdatePatchRow(tables.Row):
ajax = True
def get_data(self, request, patch_id):
- patch = api.patch.get_patch(request, patch_id)
+ patch = stx_api.patch.get_patch(request, patch_id)
return patch
@@ -205,14 +203,14 @@ class PatchesTable(tables.DataTable):
# Patch Orchestration
def get_cached_strategy(request, strategy_name, table):
- if api.vim.STRATEGY_SW_PATCH == strategy_name:
+ if stx_api.vim.STRATEGY_SW_PATCH == strategy_name:
if 'patchstrategy' not in table.kwargs:
- table.kwargs['patchstrategy'] = api.vim.get_strategy(
+ table.kwargs['patchstrategy'] = stx_api.vim.get_strategy(
request, strategy_name)
return table.kwargs['patchstrategy']
- elif api.vim.STRATEGY_SW_UPGRADE == strategy_name:
+ elif stx_api.vim.STRATEGY_SW_UPGRADE == strategy_name:
if 'upgradestrategy' not in table.kwargs:
- table.kwargs['upgradestrategy'] = api.vim.get_strategy(
+ table.kwargs['upgradestrategy'] = stx_api.vim.get_strategy(
request, strategy_name)
return table.kwargs['upgradestrategy']
@@ -225,11 +223,11 @@ class CreateStrategy(tables.LinkAction):
def allowed(self, request, datum):
try:
# Only a single strategy (patch or upgrade) can exist at a time.
- strategy = get_cached_strategy(request, api.vim.STRATEGY_SW_PATCH,
+ strategy = get_cached_strategy(request, stx_api.vim.STRATEGY_SW_PATCH,
self.table)
if not strategy:
strategy = get_cached_strategy(request,
- api.vim.STRATEGY_SW_UPGRADE,
+ stx_api.vim.STRATEGY_SW_UPGRADE,
self.table)
classes = [c for c in self.classes if c != "disabled"]
@@ -284,7 +282,7 @@ class DeleteStrategy(tables.Action):
def single(self, table, request, obj_id):
try:
- result = api.vim.delete_strategy(request, self.strategy_name,
+ result = stx_api.vim.delete_strategy(request, self.strategy_name,
self.force)
if result:
messages.success(request, "Strategy Deleted")
@@ -297,12 +295,12 @@ class DeleteStrategy(tables.Action):
class DeletePatchStrategy(DeleteStrategy):
name = "delete_patch_strategy"
- strategy_name = api.vim.STRATEGY_SW_PATCH
+ strategy_name = stx_api.vim.STRATEGY_SW_PATCH
class DeleteUpgradeStrategy(DeleteStrategy):
name = "delete_upgrade_strategy"
- strategy_name = api.vim.STRATEGY_SW_UPGRADE
+ strategy_name = stx_api.vim.STRATEGY_SW_UPGRADE
class ApplyStrategy(tables.Action):
@@ -333,7 +331,7 @@ class ApplyStrategy(tables.Action):
def single(self, table, request, obj_id):
try:
- result = api.vim.apply_strategy(request, self.strategy_name)
+ result = stx_api.vim.apply_strategy(request, self.strategy_name)
if result:
messages.success(request, "Strategy apply in progress")
else:
@@ -345,12 +343,12 @@ class ApplyStrategy(tables.Action):
class ApplyPatchStrategy(ApplyStrategy):
name = "apply_patch_strategy"
- strategy_name = api.vim.STRATEGY_SW_PATCH
+ strategy_name = stx_api.vim.STRATEGY_SW_PATCH
class ApplyUpgradeStrategy(ApplyStrategy):
name = "apply_upgrade_strategy"
- strategy_name = api.vim.STRATEGY_SW_UPGRADE
+ strategy_name = stx_api.vim.STRATEGY_SW_UPGRADE
class AbortStrategy(tables.Action):
@@ -382,7 +380,7 @@ class AbortStrategy(tables.Action):
def single(self, table, request, obj_id):
try:
- result = api.vim.abort_strategy(request, self.strategy_name)
+ result = stx_api.vim.abort_strategy(request, self.strategy_name)
if result:
messages.success(request, "Strategy abort in progress")
else:
@@ -394,12 +392,12 @@ class AbortStrategy(tables.Action):
class AbortPatchStrategy(AbortStrategy):
name = "abort_patch_strategy"
- strategy_name = api.vim.STRATEGY_SW_PATCH
+ strategy_name = stx_api.vim.STRATEGY_SW_PATCH
class AbortUpgradeStrategy(AbortStrategy):
name = "abort_upgrade_strategy"
- strategy_name = api.vim.STRATEGY_SW_UPGRADE
+ strategy_name = stx_api.vim.STRATEGY_SW_UPGRADE
class ApplyStage(tables.BatchAction):
@@ -428,7 +426,7 @@ class ApplyStage(tables.BatchAction):
or strategy.state in ['aborted', 'aborting']:
return False
# Loop through the stages and ensure this is the first in 'line'
- stages = api.vim.get_stages(request, self.strategy_name)
+ stages = stx_api.vim.get_stages(request, self.strategy_name)
for s in stages:
if s.phase.phase_name == stage.phase.phase_name and \
s.stage_id == stage.stage_id and \
@@ -444,7 +442,7 @@ class ApplyStage(tables.BatchAction):
for obj_id in obj_ids:
try:
stage_id = obj_id.split('-', 1)[1]
- result = api.vim.apply_strategy(request, self.strategy_name,
+ result = stx_api.vim.apply_strategy(request, self.strategy_name,
stage_id)
if result is None:
messages.error(request, "Strategy stage %s apply failed" %
@@ -460,12 +458,12 @@ class ApplyStage(tables.BatchAction):
class ApplyPatchStage(ApplyStage):
name = "apply_patch_stage"
- strategy_name = api.vim.STRATEGY_SW_PATCH
+ strategy_name = stx_api.vim.STRATEGY_SW_PATCH
class ApplyUpgradeStage(ApplyStage):
name = "apply_upgrade_stage"
- strategy_name = api.vim.STRATEGY_SW_UPGRADE
+ strategy_name = stx_api.vim.STRATEGY_SW_UPGRADE
class AbortStage(tables.BatchAction):
@@ -505,7 +503,7 @@ class AbortStage(tables.BatchAction):
for obj_id in obj_ids:
try:
stage_id = obj_id.split('-', 1)[1]
- result = api.vim.abort_strategy(request, self.strategy_name,
+ result = stx_api.vim.abort_strategy(request, self.strategy_name,
stage_id)
if result is None:
messages.error(request,
@@ -521,12 +519,12 @@ class AbortStage(tables.BatchAction):
class AbortPatchStage(AbortStage):
name = "abort_patch_stage"
- strategy_name = api.vim.STRATEGY_SW_PATCH
+ strategy_name = stx_api.vim.STRATEGY_SW_PATCH
class AbortUpgradeStage(AbortStage):
name = "abort_upgrade_stage"
- strategy_name = api.vim.STRATEGY_SW_UPGRADE
+ strategy_name = stx_api.vim.STRATEGY_SW_UPGRADE
def get_current_step_time(stage):
@@ -600,16 +598,16 @@ class UpdateStageRow(tables.Row):
def get_data(self, request, row_id):
phase = row_id.split('-', 1)[0]
stage_id = row_id.split('-', 1)[1]
- stage = api.vim.get_stage(request, self.strategy_name, phase, stage_id)
+ stage = stx_api.vim.get_stage(request, self.strategy_name, phase, stage_id)
return stage
class UpdatePatchStageRow(UpdateStageRow):
- strategy_name = api.vim.STRATEGY_SW_PATCH
+ strategy_name = stx_api.vim.STRATEGY_SW_PATCH
class UpdateUpgradeStageRow(UpdateStageRow):
- strategy_name = api.vim.STRATEGY_SW_UPGRADE
+ strategy_name = stx_api.vim.STRATEGY_SW_UPGRADE
class StagesTable(tables.DataTable):
@@ -690,7 +688,7 @@ class UpdateStepRow(tables.Row):
phase_name = row_id.split('-', 2)[0]
stage_id = row_id.split('-', 2)[1]
step_id = row_id.split('-', 2)[2]
- step = api.vim.get_step(
+ step = stx_api.vim.get_step(
request, self.strategy_name, phase_name, stage_id, step_id)
step.phase_name = phase_name
step.stage_id = stage_id
@@ -698,11 +696,11 @@ class UpdateStepRow(tables.Row):
class UpdatePatchStepRow(UpdateStepRow):
- strategy_name = api.vim.STRATEGY_SW_PATCH
+ strategy_name = stx_api.vim.STRATEGY_SW_PATCH
class UpdateUpgradeStepRow(UpdateStepRow):
- strategy_name = api.vim.STRATEGY_SW_UPGRADE
+ strategy_name = stx_api.vim.STRATEGY_SW_UPGRADE
class StepsTable(tables.DataTable):
diff --git a/cgcs_dashboard/dashboards/admin/software_management/tabs.py b/starlingx_dashboard/dashboards/admin/software_management/tabs.py
similarity index 78%
rename from cgcs_dashboard/dashboards/admin/software_management/tabs.py
rename to starlingx_dashboard/dashboards/admin/software_management/tabs.py
index 5fbb7b1e..770627ce 100755
--- a/cgcs_dashboard/dashboards/admin/software_management/tabs.py
+++ b/starlingx_dashboard/dashboards/admin/software_management/tabs.py
@@ -1,12 +1,9 @@
#
# Copyright (c) 2013-2016 Wind River Systems, Inc.
#
-# The right to copy, distribute, modify, or otherwise make use
-# of this software may be licensed only pursuant to the terms
-# of an applicable Wind River license agreement.
+# SPDX-License-Identifier: Apache-2.0
#
-
import logging
from cgtsclient.common import constants
@@ -14,8 +11,8 @@ from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
-from openstack_dashboard import api
-from openstack_dashboard.dashboards.admin.software_management import \
+from starlingx_dashboard import api as stx_api
+from starlingx_dashboard.dashboards.admin.software_management import \
tables as toplevel_tables
LOG = logging.getLogger(__name__)
@@ -32,7 +29,7 @@ class PatchesTab(tabs.TableTab):
phosts = []
try:
- phosts = api.patch.get_hosts(request)
+ phosts = stx_api.patch.get_hosts(request)
except Exception:
exceptions.handle(request,
_('Unable to retrieve host list.'))
@@ -46,7 +43,7 @@ class PatchesTab(tabs.TableTab):
request = self.request
patches = []
try:
- patches = api.patch.get_patches(request)
+ patches = stx_api.patch.get_patches(request)
except Exception:
exceptions.handle(self.request,
_('Unable to retrieve patch list.'))
@@ -65,7 +62,7 @@ class PatchOrchestrationTab(tabs.TableTab):
strategy = None
try:
- strategy = api.vim.get_strategy(request, api.vim.STRATEGY_SW_PATCH)
+ strategy = stx_api.vim.get_strategy(request, stx_api.vim.STRATEGY_SW_PATCH)
except Exception as ex:
LOG.exception(ex)
exceptions.handle(request,
@@ -78,13 +75,18 @@ class PatchOrchestrationTab(tabs.TableTab):
request = self.request
stages = []
try:
- stages = api.vim.get_stages(request, api.vim.STRATEGY_SW_PATCH)
+ stages = stx_api.vim.get_stages(request, stx_api.vim.STRATEGY_SW_PATCH)
except Exception:
exceptions.handle(self.request,
_('Unable to retrieve stages list.'))
return stages
+ def allowed(self, request):
+ if request.user.services_region == 'SystemController':
+ return False
+ return True
+
class UpgradeOrchestrationTab(tabs.TableTab):
table_classes = (toplevel_tables.UpgradeStagesTable,)
@@ -98,8 +100,8 @@ class UpgradeOrchestrationTab(tabs.TableTab):
strategy = None
try:
- strategy = api.vim.get_strategy(request,
- api.vim.STRATEGY_SW_UPGRADE)
+ strategy = stx_api.vim.get_strategy(request,
+ stx_api.vim.STRATEGY_SW_UPGRADE)
except Exception as ex:
LOG.exception(ex)
exceptions.handle(request,
@@ -112,7 +114,7 @@ class UpgradeOrchestrationTab(tabs.TableTab):
request = self.request
stages = []
try:
- stages = api.vim.get_stages(request, api.vim.STRATEGY_SW_UPGRADE)
+ stages = stx_api.vim.get_stages(request, stx_api.vim.STRATEGY_SW_UPGRADE)
except Exception:
exceptions.handle(self.request,
_('Unable to retrieve stages list.'))
@@ -120,8 +122,10 @@ class UpgradeOrchestrationTab(tabs.TableTab):
return stages
def allowed(self, request):
+ if request.user.services_region == 'SystemController':
+ return False
# Upgrade orchestration not available on CPE deployments
- systems = api.sysinv.system_list(request)
+ systems = stx_api.sysinv.system_list(request)
system_type = systems[0].to_dict().get('system_type')
if system_type == constants.TS_AIO:
return False
diff --git a/cgcs_dashboard/dashboards/admin/software_management/templates/software_management/_create_patch_strategy.html b/starlingx_dashboard/dashboards/admin/software_management/templates/software_management/_create_patch_strategy.html
similarity index 97%
rename from cgcs_dashboard/dashboards/admin/software_management/templates/software_management/_create_patch_strategy.html
rename to starlingx_dashboard/dashboards/admin/software_management/templates/software_management/_create_patch_strategy.html
index c9ee298e..32b796e3 100755
--- a/cgcs_dashboard/dashboards/admin/software_management/templates/software_management/_create_patch_strategy.html
+++ b/starlingx_dashboard/dashboards/admin/software_management/templates/software_management/_create_patch_strategy.html
@@ -1,35 +1,35 @@
-{% extends "horizon/common/_modal_form.html" %}
-{% load i18n %}
-
-{% block form_action %}{% url 'horizon:admin:software_management:createpatchstrategy' %}{% endblock %}
-
-{% block modal-header %}{% trans "Create Patch Strategy" %}{% endblock %}
-
-{% block modal-body %}
-
-
-
-
-
{% trans "Description:" %}
-
- {% trans "Create a strategy to specify how the system should be patched." %}
-
-
- {% trans "There are " %}{{ alarms }}{% trans " active alarms on the system, " %}{{ affecting }}{% trans " of which are management affecting." %}
-
- {% if affecting > 0 %}
- {% trans "These management affecting alarms must be addressed before orchestration will be successful" %}
- {% else %}
- {% trans "These alarms can be ignored by choosing relaxed alarm restrictions." %}
- {% endif %}
-
+ {% trans "Create a strategy to specify how the system should be patched." %}
+
+
+ {% trans "There are " %}{{ alarms }}{% trans " active alarms on the system, " %}{{ affecting }}{% trans " of which are management affecting." %}
+
+ {% if affecting > 0 %}
+ {% trans "These management affecting alarms must be addressed before orchestration will be successful" %}
+ {% else %}
+ {% trans "These alarms can be ignored by choosing relaxed alarm restrictions." %}
+ {% endif %}
+
- {% trans "Create a strategy to specify how the system should be upgraded." %}
-
-
- {% trans "There are " %}{{ alarms }}{% trans " active alarms on the system, " %}{{ affecting }}{% trans " of which are management affecting." %}
-
- {% if affecting > 0 %}
- {% trans "These management affecting alarms must be addressed before orchestration will be successful" %}
- {% else %}
- {% trans "These alarms can be ignored by choosing relaxed alarm restrictions." %}
- {% endif %}
-
+ {% trans "Create a strategy to specify how the system should be upgraded." %}
+
+
+ {% trans "There are " %}{{ alarms }}{% trans " active alarms on the system, " %}{{ affecting }}{% trans " of which are management affecting." %}
+
+ {% if affecting > 0 %}
+ {% trans "These management affecting alarms must be addressed before orchestration will be successful" %}
+ {% else %}
+ {% trans "These alarms can be ignored by choosing relaxed alarm restrictions." %}
+ {% endif %}
+
+
+
+{% endblock %}
+
+{% block modal-footer %}
+ Cancel
+
+{% endblock %}
diff --git a/cgcs_dashboard/dashboards/admin/software_management/templates/software_management/_detail_patches.html b/starlingx_dashboard/dashboards/admin/software_management/templates/software_management/_detail_patches.html
similarity index 96%
rename from cgcs_dashboard/dashboards/admin/software_management/templates/software_management/_detail_patches.html
rename to starlingx_dashboard/dashboards/admin/software_management/templates/software_management/_detail_patches.html
index c3797ae7..c98b84fd 100755
--- a/cgcs_dashboard/dashboards/admin/software_management/templates/software_management/_detail_patches.html
+++ b/starlingx_dashboard/dashboards/admin/software_management/templates/software_management/_detail_patches.html
@@ -1,54 +1,54 @@
-{% extends 'base.html' %}
-{% load i18n breadcrumb_nav %}
-{% block title %}{% trans "Patch Details" %}{% endblock %}
-
-{% block main %}
-
{{patch.patch_id }}
-
-
-
-
-
{% trans "Info" %}
-
-
-
{% trans "Patch State" %}
-
{{ patch.patchstate }}
-
{% trans "Platform Release Version" %}
-
{{ patch.sw_version }}
-
{% trans "Reboot-Required" %}
-
{{ patch.reboot_required }}
-
{% trans "Patch Status Code" %}
-
{{ patch.status }}
- {% if patch.unremovable == "Y" %}
-
{% trans "Unremovable" %}
-
{% trans "This patch cannot be removed" %}
- {% endif %}
-
{% trans "Required Patches" %}
-
{{ patch.requires_display|linebreaks }}
-
-
-
{% trans "Summary" %}
-
{{ patch.summary|linebreaks }}
-
-
-
{% trans "Description" %}
-
{{ patch.description|linebreaks }}
-
-
-
{% trans "Warnings" %}
-
{{ patch.warnings|linebreaks }}
-
-
-
{% trans "Installation Instructions" %}
-
{{ patch.install_instructions|linebreaks }}
-
-
-
{% trans "Contents" %}
-
{{ patch.contents_display|linebreaks }}
-
-
-
-
-{% endblock %}
-
-
+{% extends 'base.html' %}
+{% load i18n breadcrumb_nav %}
+{% block title %}{% trans "Patch Details" %}{% endblock %}
+
+{% block main %}
+
{{patch.patch_id }}
+
+
+
+
+
{% trans "Info" %}
+
+
+
{% trans "Patch State" %}
+
{{ patch.patchstate }}
+
{% trans "Platform Release Version" %}
+
{{ patch.sw_version }}
+
{% trans "Reboot-Required" %}
+
{{ patch.reboot_required }}
+
{% trans "Patch Status Code" %}
+
{{ patch.status }}
+ {% if patch.unremovable == "Y" %}
+
{% trans "Unremovable" %}
+
{% trans "This patch cannot be removed" %}
+ {% endif %}
+
{% trans "Required Patches" %}
+
{{ patch.requires_display|linebreaks }}
+
+
+
{% trans "Summary" %}
+
{{ patch.summary|linebreaks }}
+
+
+
{% trans "Description" %}
+
{{ patch.description|linebreaks }}
+
+
+
{% trans "Warnings" %}
+
{{ patch.warnings|linebreaks }}
+
+
+
{% trans "Installation Instructions" %}
+
{{ patch.install_instructions|linebreaks }}
+
+
+
{% trans "Contents" %}
+
{{ patch.contents_display|linebreaks }}
+
+
+
+
+{% endblock %}
+
+
diff --git a/cgcs_dashboard/dashboards/admin/software_management/templates/software_management/_detail_stage.html b/starlingx_dashboard/dashboards/admin/software_management/templates/software_management/_detail_stage.html
similarity index 95%
rename from cgcs_dashboard/dashboards/admin/software_management/templates/software_management/_detail_stage.html
rename to starlingx_dashboard/dashboards/admin/software_management/templates/software_management/_detail_stage.html
index 7ad5dac4..5e029301 100755
--- a/cgcs_dashboard/dashboards/admin/software_management/templates/software_management/_detail_stage.html
+++ b/starlingx_dashboard/dashboards/admin/software_management/templates/software_management/_detail_stage.html
@@ -1,57 +1,57 @@
-{% extends 'base.html' %}
-{% load i18n breadcrumb_nav %}
-{% block title %}{% trans "Stage Details" %}{% endblock %}
-
-{% block main %}
-
Stage {{ stage.stage_id }} of {{ stage.phase.phase_name|title }} Phase