Rename service to 'container-infra'

Magnum renames its service_type [1]. According to that,
this patch renames service name, Angular module name,
related URLs and related strings.

[1] https://bugs.launchpad.net/magnum/+bug/1584251

Change-Id: If730ff75826b7f6d50b308b78f8e881da6696966
Implements: blueprint rename-service
This commit is contained in:
Shu Muto
2016-05-27 17:12:54 +09:00
parent 5767efec84
commit b31c2bfc90
57 changed files with 143 additions and 142 deletions

View File

@@ -48,9 +48,9 @@ Install Magnum UI with all dependencies in your virtual environment::
And enable it in Horizon:: And enable it in Horizon::
cp ../magnum-ui/enabled/_50_project_containers_panelgroup.py openstack_dashboard/local/enabled cp ../magnum-ui/enabled/_50_project_container-infra_panelgroup.py openstack_dashboard/local/enabled
cp ../magnum-ui/enabled/_51_project_containers_bays_panel.py openstack_dashboard/local/enabled cp ../magnum-ui/enabled/_51_project_container-infra_bays_panel.py openstack_dashboard/local/enabled
cp ../magnum-ui/enabled/_52_project_containers_baymodels_panel.py openstack_dashboard/local/enabled cp ../magnum-ui/enabled/_52_project_container-infra_baymodels_panel.py openstack_dashboard/local/enabled
To run horizon with the newly enabled Magnum UI plugin run:: To run horizon with the newly enabled Magnum UI plugin run::

View File

@@ -14,16 +14,16 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
# The slug of the panel group to be added to HORIZON_CONFIG. Required. # The slug of the panel group to be added to HORIZON_CONFIG. Required.
PANEL_GROUP = 'containers' PANEL_GROUP = 'container-infra'
# The display name of the PANEL_GROUP. Required. # The display name of the PANEL_GROUP. Required.
PANEL_GROUP_NAME = _('Containers') PANEL_GROUP_NAME = _('Container Infrastructure')
# The slug of the dashboard the PANEL_GROUP associated with. Required. # The slug of the dashboard the PANEL_GROUP associated with. Required.
PANEL_GROUP_DASHBOARD = 'project' PANEL_GROUP_DASHBOARD = 'project'
ADD_INSTALLED_APPS = ['magnum_ui'] ADD_INSTALLED_APPS = ['magnum_ui']
ADD_ANGULAR_MODULES = [ ADD_ANGULAR_MODULES = [
'horizon.dashboard.containers' 'horizon.dashboard.container-infra'
] ]
ADD_JS_FILES = [ ADD_JS_FILES = [
@@ -31,7 +31,7 @@ ADD_JS_FILES = [
] ]
ADD_SCSS_FILES = [ ADD_SCSS_FILES = [
'dashboard/containers/containers.scss' 'dashboard/container-infra/container-infra.scss'
] ]
AUTO_DISCOVER_STATIC_FILES = True AUTO_DISCOVER_STATIC_FILES = True

View File

@@ -15,7 +15,7 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required. # The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'bays' PANEL = 'bays'
# The slug of the panel group the PANEL is associated with. # The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'containers' PANEL_GROUP = 'container-infra'
# The slug of the dashboard the PANEL associated with. Required. # The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project' PANEL_DASHBOARD = 'project'

View File

@@ -15,7 +15,7 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required. # The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'baymodels' PANEL = 'baymodels'
# The slug of the panel group the PANEL is associated with. # The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'containers' PANEL_GROUP = 'container-infra'
# The slug of the dashboard the PANEL associated with. Required. # The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project' PANEL_DASHBOARD = 'project'

View File

@@ -39,9 +39,10 @@ BAY_CREATE_ATTRS = ['name', 'baymodel_id', 'node_count', 'discovery_url',
def magnumclient(request): def magnumclient(request):
magnum_url = "" magnum_url = ""
try: try:
magnum_url = base.url_for(request, 'container') magnum_url = base.url_for(request, 'container-infra')
except exceptions.ServiceCatalogException: except exceptions.ServiceCatalogException:
LOG.debug('No Containers service is configured.') LOG.debug('No Container Infrastructure Management service is '
'configured.')
return None return None
LOG.debug('magnumclient connection created using the token "%s" and url' LOG.debug('magnumclient connection created using the token "%s" and url'

View File

@@ -33,7 +33,7 @@ def change_to_id(obj):
@urls.register @urls.register
class Baymodel(generic.View): class Baymodel(generic.View):
"""API for retrieving a single baymodel""" """API for retrieving a single baymodel"""
url_regex = r'containers/baymodels/(?P<baymodel_id>[^/]+)$' url_regex = r'container-infra/baymodels/(?P<baymodel_id>[^/]+)$'
@rest_utils.ajax() @rest_utils.ajax()
def get(self, request, baymodel_id): def get(self, request, baymodel_id):
@@ -44,7 +44,7 @@ class Baymodel(generic.View):
@urls.register @urls.register
class Baymodels(generic.View): class Baymodels(generic.View):
"""API for Magnum Baymodels""" """API for Magnum Baymodels"""
url_regex = r'containers/baymodels/$' url_regex = r'container-infra/baymodels/$'
@rest_utils.ajax() @rest_utils.ajax()
def get(self, request): def get(self, request):
@@ -73,14 +73,14 @@ class Baymodels(generic.View):
""" """
new_baymodel = magnum.baymodel_create(request, **request.DATA) new_baymodel = magnum.baymodel_create(request, **request.DATA)
return rest_utils.CreatedResponse( return rest_utils.CreatedResponse(
'/api/containers/baymodel/%s' % new_baymodel.uuid, '/api/container-infra/baymodel/%s' % new_baymodel.uuid,
new_baymodel.to_dict()) new_baymodel.to_dict())
@urls.register @urls.register
class Bay(generic.View): class Bay(generic.View):
"""API for retrieving a single bay""" """API for retrieving a single bay"""
url_regex = r'containers/bays/(?P<bay_id>[^/]+)$' url_regex = r'container-infra/bays/(?P<bay_id>[^/]+)$'
@rest_utils.ajax() @rest_utils.ajax()
def get(self, request, bay_id): def get(self, request, bay_id):
@@ -91,7 +91,7 @@ class Bay(generic.View):
@urls.register @urls.register
class Bays(generic.View): class Bays(generic.View):
"""API for Magnum Bays""" """API for Magnum Bays"""
url_regex = r'containers/bays/$' url_regex = r'container-infra/bays/$'
@rest_utils.ajax() @rest_utils.ajax()
def get(self, request): def get(self, request):
@@ -120,5 +120,5 @@ class Bays(generic.View):
""" """
new_bay = magnum.bay_create(request, **request.DATA) new_bay = magnum.bay_create(request, **request.DATA)
return rest_utils.CreatedResponse( return rest_utils.CreatedResponse(
'/api/containers/bay/%s' % new_bay.uuid, '/api/container-infra/bay/%s' % new_bay.uuid,
new_bay.to_dict()) new_bay.to_dict())

View File

@@ -17,21 +17,21 @@
/** /**
* @ngdoc overview * @ngdoc overview
* @ngname horizon.dashboard.containers.baymodels.actions * @ngname horizon.dashboard.container-infra.baymodels.actions
* *
* @description * @description
* Provides all of the actions for baymodels. * Provides all of the actions for baymodels.
*/ */
angular.module('horizon.dashboard.containers.baymodels.actions', ['horizon.framework', 'horizon.dashboard.containers']) angular.module('horizon.dashboard.container-infra.baymodels.actions', ['horizon.framework', 'horizon.dashboard.container-infra'])
.run(registerBaymodelActions); .run(registerBaymodelActions);
registerBaymodelActions.$inject = [ registerBaymodelActions.$inject = [
'horizon.framework.conf.resource-type-registry.service', 'horizon.framework.conf.resource-type-registry.service',
'horizon.framework.util.i18n.gettext', 'horizon.framework.util.i18n.gettext',
'horizon.dashboard.containers.baymodels.create.service', 'horizon.dashboard.container-infra.baymodels.create.service',
'horizon.dashboard.containers.baymodels.delete.service', 'horizon.dashboard.container-infra.baymodels.delete.service',
'horizon.dashboard.containers.bays.create.service', 'horizon.dashboard.container-infra.bays.create.service',
'horizon.dashboard.containers.baymodels.resourceType', 'horizon.dashboard.container-infra.baymodels.resourceType',
]; ];
function registerBaymodelActions( function registerBaymodelActions(

View File

@@ -19,7 +19,7 @@
/** /**
* @ngdoc overview * @ngdoc overview
* @name horizon.dashboard.containers.baymodels * @name horizon.dashboard.container-infra.baymodels
* @ngModule * @ngModule
* *
* @description * @description
@@ -27,19 +27,19 @@
* panel * panel
*/ */
angular angular
.module('horizon.dashboard.containers.baymodels', ['horizon.dashboard.containers.baymodels.actions']) .module('horizon.dashboard.container-infra.baymodels', ['horizon.dashboard.container-infra.baymodels.actions'])
.constant('horizon.dashboard.containers.baymodels.events', events()) .constant('horizon.dashboard.container-infra.baymodels.events', events())
.constant('horizon.dashboard.containers.baymodels.resourceType', 'OS::Magnum::Baymodel'); .constant('horizon.dashboard.container-infra.baymodels.resourceType', 'OS::Magnum::Baymodel');
/** /**
* @ngdoc constant * @ngdoc constant
* @name horizon.dashboard.containers.baymodels.events * @name horizon.dashboard.container-infra.baymodels.events
* @description A list of events used by Baymodels * @description A list of events used by Baymodels
*/ */
function events() { function events() {
return { return {
CREATE_SUCCESS: 'horizon.dashboard.containers.baymodels.CREATE_SUCCESS', CREATE_SUCCESS: 'horizon.dashboard.container-infra.baymodels.CREATE_SUCCESS',
DELETE_SUCCESS: 'horizon.dashboard.containers.baymodels.DELETE_SUCCESS' DELETE_SUCCESS: 'horizon.dashboard.container-infra.baymodels.DELETE_SUCCESS'
}; };
} }
})(); })();

View File

@@ -16,9 +16,9 @@
(function() { (function() {
'use strict'; 'use strict';
describe('horizon.dashboard.containers.baymodels', function() { describe('horizon.dashboard.container-infra.baymodels', function() {
it('should exist', function() { it('should exist', function() {
expect(angular.module('horizon.dashboard.containers.baymodels')).toBeDefined(); expect(angular.module('horizon.dashboard.container-infra.baymodels')).toBeDefined();
}); });
}); });

View File

@@ -18,7 +18,7 @@
'use strict'; 'use strict';
angular angular
.module('horizon.dashboard.containers.baymodels') .module('horizon.dashboard.container-infra.baymodels')
.factory('baymodelModel', baymodelModel); .factory('baymodelModel', baymodelModel);
baymodelModel.$inject = [ baymodelModel.$inject = [

View File

@@ -18,11 +18,11 @@
'use strict'; 'use strict';
angular angular
.module('horizon.dashboard.containers.baymodels') .module('horizon.dashboard.container-infra.baymodels')
.factory('horizon.dashboard.containers.baymodels.workflow', baymodelWorkflow); .factory('horizon.dashboard.container-infra.baymodels.workflow', baymodelWorkflow);
baymodelWorkflow.$inject = [ baymodelWorkflow.$inject = [
'horizon.dashboard.containers.basePath', 'horizon.dashboard.container-infra.basePath',
'horizon.app.core.workflow.factory', 'horizon.app.core.workflow.factory',
'horizon.framework.util.i18n.gettext' 'horizon.framework.util.i18n.gettext'
]; ];

View File

@@ -19,19 +19,19 @@
/** /**
* @ngdoc overview * @ngdoc overview
* @name horizon.dashboard.containers.baymodels.create.service * @name horizon.dashboard.container-infra.baymodels.create.service
* @description Service for the containers bay model create modal * @description Service for the container-infra bay model create modal
*/ */
angular angular
.module('horizon.dashboard.containers.baymodels') .module('horizon.dashboard.container-infra.baymodels')
.factory('horizon.dashboard.containers.baymodels.create.service', createService); .factory('horizon.dashboard.container-infra.baymodels.create.service', createService);
createService.$inject = [ createService.$inject = [
'baymodelModel', 'baymodelModel',
'horizon.framework.widgets.modal.wizard-modal.service', 'horizon.framework.widgets.modal.wizard-modal.service',
'horizon.framework.widgets.toast.service', 'horizon.framework.widgets.toast.service',
'horizon.dashboard.containers.baymodels.workflow', 'horizon.dashboard.container-infra.baymodels.workflow',
'horizon.dashboard.containers.baymodels.events', 'horizon.dashboard.container-infra.baymodels.events',
'horizon.app.core.openstack-service-api.policy', 'horizon.app.core.openstack-service-api.policy',
'horizon.framework.util.i18n.gettext', 'horizon.framework.util.i18n.gettext',
'horizon.framework.util.q.extensions' 'horizon.framework.util.q.extensions'

View File

@@ -26,13 +26,13 @@
* Controller for the bay model info step in create workflow * Controller for the bay model info step in create workflow
*/ */
angular angular
.module('horizon.dashboard.containers.baymodels') .module('horizon.dashboard.container-infra.baymodels')
.controller('createBaymodelInfoController', createBaymodelInfoController); .controller('createBaymodelInfoController', createBaymodelInfoController);
createBaymodelInfoController.$inject = [ createBaymodelInfoController.$inject = [
'$q', '$q',
'$scope', '$scope',
'horizon.dashboard.containers.basePath', 'horizon.dashboard.container-infra.basePath',
'horizon.app.core.openstack-service-api.magnum', 'horizon.app.core.openstack-service-api.magnum',
'horizon.framework.util.i18n.gettext' 'horizon.framework.util.i18n.gettext'
]; ];

View File

@@ -26,13 +26,13 @@
* Controller for the bay model labels step in create workflow * Controller for the bay model labels step in create workflow
*/ */
angular angular
.module('horizon.dashboard.containers.baymodels') .module('horizon.dashboard.container-infra.baymodels')
.controller('createBaymodelLabelsController', createBaymodelLabelsController); .controller('createBaymodelLabelsController', createBaymodelLabelsController);
createBaymodelLabelsController.$inject = [ createBaymodelLabelsController.$inject = [
'$q', '$q',
'$scope', '$scope',
'horizon.dashboard.containers.basePath', 'horizon.dashboard.container-infra.basePath',
'horizon.app.core.openstack-service-api.magnum' 'horizon.app.core.openstack-service-api.magnum'
]; ];

View File

@@ -26,13 +26,13 @@
* Controller for the bay model network step in create workflow * Controller for the bay model network step in create workflow
*/ */
angular angular
.module('horizon.dashboard.containers.baymodels') .module('horizon.dashboard.container-infra.baymodels')
.controller('createBaymodelNetworkController', createBaymodelNetworkController); .controller('createBaymodelNetworkController', createBaymodelNetworkController);
createBaymodelNetworkController.$inject = [ createBaymodelNetworkController.$inject = [
'$q', '$q',
'$scope', '$scope',
'horizon.dashboard.containers.basePath', 'horizon.dashboard.container-infra.basePath',
'horizon.app.core.openstack-service-api.magnum' 'horizon.app.core.openstack-service-api.magnum'
]; ];

View File

@@ -26,13 +26,13 @@
* Controller for the bay model spec step in create workflow * Controller for the bay model spec step in create workflow
*/ */
angular angular
.module('horizon.dashboard.containers.baymodels') .module('horizon.dashboard.container-infra.baymodels')
.controller('createBaymodelSpecController', createBaymodelSpecController); .controller('createBaymodelSpecController', createBaymodelSpecController);
createBaymodelSpecController.$inject = [ createBaymodelSpecController.$inject = [
'$q', '$q',
'$scope', '$scope',
'horizon.dashboard.containers.basePath', 'horizon.dashboard.container-infra.basePath',
'horizon.app.core.openstack-service-api.magnum', 'horizon.app.core.openstack-service-api.magnum',
'horizon.app.core.openstack-service-api.nova', 'horizon.app.core.openstack-service-api.nova',
'horizon.app.core.openstack-service-api.glance' 'horizon.app.core.openstack-service-api.glance'

View File

@@ -16,8 +16,8 @@
'use strict'; 'use strict';
angular angular
.module('horizon.dashboard.containers.baymodels') .module('horizon.dashboard.container-infra.baymodels')
.factory('horizon.dashboard.containers.baymodels.delete.service', deleteService); .factory('horizon.dashboard.container-infra.baymodels.delete.service', deleteService);
deleteService.$inject = [ deleteService.$inject = [
'horizon.app.core.openstack-service-api.magnum', 'horizon.app.core.openstack-service-api.magnum',
@@ -25,12 +25,12 @@
'horizon.framework.widgets.modal.deleteModalService', 'horizon.framework.widgets.modal.deleteModalService',
'horizon.framework.util.i18n.gettext', 'horizon.framework.util.i18n.gettext',
'horizon.framework.util.q.extensions', 'horizon.framework.util.q.extensions',
'horizon.dashboard.containers.baymodels.events' 'horizon.dashboard.container-infra.baymodels.events'
]; ];
/** /**
* @ngDoc factory * @ngDoc factory
* @name horizon.dashboard.containers.baymodels.delete.service * @name horizon.dashboard.container-infra.baymodels.delete.service
* *
* @Description * @Description
* Brings up the delete baymodels confirmation modal dialog. * Brings up the delete baymodels confirmation modal dialog.

View File

@@ -17,7 +17,7 @@
"use strict"; "use strict";
angular angular
.module('horizon.dashboard.containers.baymodels') .module('horizon.dashboard.container-infra.baymodels')
.controller('BaymodelDetailController', BaymodelDetailController); .controller('BaymodelDetailController', BaymodelDetailController);
BaymodelDetailController.$inject = [ BaymodelDetailController.$inject = [
@@ -27,10 +27,10 @@
'$routeParams', '$routeParams',
'horizon.app.core.openstack-service-api.magnum', 'horizon.app.core.openstack-service-api.magnum',
'horizon.app.core.openstack-service-api.glance', 'horizon.app.core.openstack-service-api.glance',
'horizon.dashboard.containers.baymodels.events', 'horizon.dashboard.container-infra.baymodels.events',
'horizon.dashboard.containers.bays.events', 'horizon.dashboard.container-infra.bays.events',
'horizon.framework.conf.resource-type-registry.service', 'horizon.framework.conf.resource-type-registry.service',
'horizon.dashboard.containers.baymodels.resourceType' 'horizon.dashboard.container-infra.baymodels.resourceType'
]; ];
function BaymodelDetailController($scope, $window, $location, $routeParams, magnum, glance, events, bayEvents, registry, baymodelResourceType) { function BaymodelDetailController($scope, $window, $location, $routeParams, magnum, glance, events, bayEvents, registry, baymodelResourceType) {

View File

@@ -19,27 +19,27 @@
/** /**
* @ngdoc overview * @ngdoc overview
* @name containersBaymodelsTableController * @name BaymodelsTableController
* @ngController * @ngController
* *
* @description * @description
* Controller for the containers bay model table * Controller for the container-infra bay model table
*/ */
angular angular
.module('horizon.dashboard.containers.baymodels') .module('horizon.dashboard.container-infra.baymodels')
.controller('containersBaymodelsTableController', containersBaymodelsTableController); .controller('BaymodelsTableController', BaymodelsTableController);
containersBaymodelsTableController.$inject = [ BaymodelsTableController.$inject = [
'$scope', '$scope',
'$location', '$location',
'horizon.app.core.openstack-service-api.magnum', 'horizon.app.core.openstack-service-api.magnum',
'horizon.dashboard.containers.baymodels.events', 'horizon.dashboard.container-infra.baymodels.events',
'horizon.dashboard.containers.bays.events', 'horizon.dashboard.container-infra.bays.events',
'horizon.framework.conf.resource-type-registry.service', 'horizon.framework.conf.resource-type-registry.service',
'horizon.dashboard.containers.baymodels.resourceType' 'horizon.dashboard.container-infra.baymodels.resourceType'
]; ];
function containersBaymodelsTableController($scope, $location, magnum, events, bayEvents, registry, baymodelResourceType) { function BaymodelsTableController($scope, $location, magnum, events, bayEvents, registry, baymodelResourceType) {
var ctrl = this; var ctrl = this;
ctrl.baymodels = []; ctrl.baymodels = [];
ctrl.baymodelsSrc = []; ctrl.baymodelsSrc = [];

View File

@@ -1,5 +1,5 @@
<div> <div>
<hz-magic-search-context ng-controller="containersBaymodelsTableController as table" <hz-magic-search-context ng-controller="BaymodelsTableController as table"
filter-facets="table.baymodelFacets"> filter-facets="table.baymodelFacets">
<hz-magic-search-bar></hz-magic-search-bar> <hz-magic-search-bar></hz-magic-search-bar>
<actions class="batch-action" allowed="table.baymodelResource.batchActions" type="batch"></actions> <actions class="batch-action" allowed="table.baymodelResource.batchActions" type="batch"></actions>

View File

@@ -17,20 +17,20 @@
/** /**
* @ngdoc overview * @ngdoc overview
* @ngname horizon.dashboard.containers.bays.actions * @ngname horizon.dashboard.container-infra.bays.actions
* *
* @description * @description
* Provides all of the actions for bays. * Provides all of the actions for bays.
*/ */
angular.module('horizon.dashboard.containers.bays.actions', ['horizon.framework', 'horizon.dashboard.containers']) angular.module('horizon.dashboard.container-infra.bays.actions', ['horizon.framework', 'horizon.dashboard.container-infra'])
.run(registerBayActions); .run(registerBayActions);
registerBayActions.$inject = [ registerBayActions.$inject = [
'horizon.framework.conf.resource-type-registry.service', 'horizon.framework.conf.resource-type-registry.service',
'horizon.framework.util.i18n.gettext', 'horizon.framework.util.i18n.gettext',
'horizon.dashboard.containers.bays.create.service', 'horizon.dashboard.container-infra.bays.create.service',
'horizon.dashboard.containers.bays.delete.service', 'horizon.dashboard.container-infra.bays.delete.service',
'horizon.dashboard.containers.bays.resourceType', 'horizon.dashboard.container-infra.bays.resourceType',
]; ];
function registerBayActions( function registerBayActions(

View File

@@ -19,7 +19,7 @@
/** /**
* @ngdoc overview * @ngdoc overview
* @name horizon.dashboard.containers.bays * @name horizon.dashboard.container-infra.bays
* @ngModule * @ngModule
* *
* @description * @description
@@ -27,9 +27,9 @@
* panel * panel
*/ */
angular angular
.module('horizon.dashboard.containers.bays', ['horizon.dashboard.containers.bays.actions']) .module('horizon.dashboard.container-infra.bays', ['horizon.dashboard.container-infra.bays.actions'])
.constant('horizon.dashboard.containers.bays.events', events()) .constant('horizon.dashboard.container-infra.bays.events', events())
.constant('horizon.dashboard.containers.bays.resourceType', 'OS::Magnum::Bay'); .constant('horizon.dashboard.container-infra.bays.resourceType', 'OS::Magnum::Bay');
/** /**
* @ngdoc constant * @ngdoc constant
@@ -38,8 +38,8 @@
*/ */
function events() { function events() {
return { return {
CREATE_SUCCESS: 'horizon.dashboard.containers.bays.CREATE_SUCCESS', CREATE_SUCCESS: 'horizon.dashboard.container-infra.bays.CREATE_SUCCESS',
DELETE_SUCCESS: 'horizon.dashboard.containers.bays.DELETE_SUCCESS' DELETE_SUCCESS: 'horizon.dashboard.container-infra.bays.DELETE_SUCCESS'
}; };
} }
})(); })();

View File

@@ -16,9 +16,9 @@
(function() { (function() {
'use strict'; 'use strict';
describe('horizon.dashboard.containers.bays', function() { describe('horizon.dashboard.container-infra.bays', function() {
it('should exist', function() { it('should exist', function() {
expect(angular.module('horizon.dashboard.containers.bays')).toBeDefined(); expect(angular.module('horizon.dashboard.container-infra.bays')).toBeDefined();
}); });
}); });

View File

@@ -18,8 +18,8 @@
'use strict'; 'use strict';
angular angular
.module('horizon.dashboard.containers.bays') .module('horizon.dashboard.container-infra.bays')
.factory('horizon.dashboard.containers.bays.bayModel', bayModel); .factory('horizon.dashboard.container-infra.bays.bayModel', bayModel);
bayModel.$inject = [ bayModel.$inject = [
'horizon.app.core.openstack-service-api.magnum' 'horizon.app.core.openstack-service-api.magnum'

View File

@@ -18,11 +18,11 @@
'use strict'; 'use strict';
angular angular
.module('horizon.dashboard.containers.bays') .module('horizon.dashboard.container-infra.bays')
.factory('horizon.dashboard.containers.bays.workflow', bayWorkflow); .factory('horizon.dashboard.container-infra.bays.workflow', bayWorkflow);
bayWorkflow.$inject = [ bayWorkflow.$inject = [
'horizon.dashboard.containers.basePath', 'horizon.dashboard.container-infra.basePath',
'horizon.app.core.workflow.factory', 'horizon.app.core.workflow.factory',
'horizon.framework.util.i18n.gettext' 'horizon.framework.util.i18n.gettext'
]; ];

View File

@@ -17,19 +17,19 @@
/** /**
* @ngdoc overview * @ngdoc overview
* @name horizon.dashboard.containers.bays.create.service * @name horizon.dashboard.container-infra.bays.create.service
* @description Service for the containers bay create modal * @description Service for the container-infra bay create modal
*/ */
angular angular
.module('horizon.dashboard.containers.bays') .module('horizon.dashboard.container-infra.bays')
.factory('horizon.dashboard.containers.bays.create.service', createService); .factory('horizon.dashboard.container-infra.bays.create.service', createService);
createService.$inject = [ createService.$inject = [
'horizon.dashboard.containers.bays.bayModel', 'horizon.dashboard.container-infra.bays.bayModel',
'horizon.framework.widgets.modal.wizard-modal.service', 'horizon.framework.widgets.modal.wizard-modal.service',
'horizon.framework.widgets.toast.service', 'horizon.framework.widgets.toast.service',
'horizon.dashboard.containers.bays.workflow', 'horizon.dashboard.container-infra.bays.workflow',
'horizon.dashboard.containers.bays.events', 'horizon.dashboard.container-infra.bays.events',
'horizon.app.core.openstack-service-api.policy', 'horizon.app.core.openstack-service-api.policy',
'horizon.framework.util.i18n.gettext', 'horizon.framework.util.i18n.gettext',
'horizon.framework.util.q.extensions' 'horizon.framework.util.q.extensions'

View File

@@ -23,16 +23,16 @@
* @ngController * @ngController
* *
* @description * @description
* Controller for the containers bay info step in create workflow * Controller for the container-infra bay info step in create workflow
*/ */
angular angular
.module('horizon.dashboard.containers.bays') .module('horizon.dashboard.container-infra.bays')
.controller('createBayInfoController', createBayInfoController); .controller('createBayInfoController', createBayInfoController);
createBayInfoController.$inject = [ createBayInfoController.$inject = [
'$q', '$q',
'$scope', '$scope',
'horizon.dashboard.containers.basePath', 'horizon.dashboard.container-infra.basePath',
'horizon.app.core.openstack-service-api.magnum' 'horizon.app.core.openstack-service-api.magnum'
]; ];

View File

@@ -23,15 +23,15 @@
* @ngController * @ngController
* *
* @description * @description
* Controller for the containers bay misc step in create workflow * Controller for the container-infra bay misc step in create workflow
*/ */
angular angular
.module('horizon.dashboard.containers.bays') .module('horizon.dashboard.container-infra.bays')
.controller('createBayMiscController', createBayMiscController); .controller('createBayMiscController', createBayMiscController);
createBayMiscController.$inject = [ createBayMiscController.$inject = [
'$scope', '$scope',
'horizon.dashboard.containers.basePath', 'horizon.dashboard.container-infra.basePath',
'horizon.app.core.openstack-service-api.magnum' 'horizon.app.core.openstack-service-api.magnum'
]; ];

View File

@@ -23,15 +23,15 @@
* @ngController * @ngController
* *
* @description * @description
* Controller for the containers bay size step in create workflow * Controller for the container-infra bay size step in create workflow
*/ */
angular angular
.module('horizon.dashboard.containers.bays') .module('horizon.dashboard.container-infra.bays')
.controller('createBaySizeController', createBaySizeController); .controller('createBaySizeController', createBaySizeController);
createBaySizeController.$inject = [ createBaySizeController.$inject = [
'$scope', '$scope',
'horizon.dashboard.containers.basePath', 'horizon.dashboard.container-infra.basePath',
'horizon.app.core.openstack-service-api.magnum' 'horizon.app.core.openstack-service-api.magnum'
]; ];

View File

@@ -16,8 +16,8 @@
'use strict'; 'use strict';
angular angular
.module('horizon.dashboard.containers.bays') .module('horizon.dashboard.container-infra.bays')
.factory('horizon.dashboard.containers.bays.delete.service', deleteService); .factory('horizon.dashboard.container-infra.bays.delete.service', deleteService);
deleteService.$inject = [ deleteService.$inject = [
'horizon.app.core.openstack-service-api.magnum', 'horizon.app.core.openstack-service-api.magnum',
@@ -25,12 +25,12 @@
'horizon.framework.widgets.modal.deleteModalService', 'horizon.framework.widgets.modal.deleteModalService',
'horizon.framework.util.i18n.gettext', 'horizon.framework.util.i18n.gettext',
'horizon.framework.util.q.extensions', 'horizon.framework.util.q.extensions',
'horizon.dashboard.containers.bays.events' 'horizon.dashboard.container-infra.bays.events'
]; ];
/** /**
* @ngDoc factory * @ngDoc factory
* @name horizon.dashboard.containers.bays.delete.service * @name horizon.dashboard.container-infra.bays.delete.service
* *
* @Description * @Description
* Brings up the delete bays confirmation modal dialog. * Brings up the delete bays confirmation modal dialog.

View File

@@ -17,7 +17,7 @@
"use strict"; "use strict";
angular angular
.module('horizon.dashboard.containers.bays') .module('horizon.dashboard.container-infra.bays')
.controller('BayDetailController', BayDetailController); .controller('BayDetailController', BayDetailController);
BayDetailController.$inject = [ BayDetailController.$inject = [
@@ -26,9 +26,9 @@
'$location', '$location',
'$routeParams', '$routeParams',
'horizon.app.core.openstack-service-api.magnum', 'horizon.app.core.openstack-service-api.magnum',
'horizon.dashboard.containers.bays.events', 'horizon.dashboard.container-infra.bays.events',
'horizon.framework.conf.resource-type-registry.service', 'horizon.framework.conf.resource-type-registry.service',
'horizon.dashboard.containers.bays.resourceType' 'horizon.dashboard.container-infra.bays.resourceType'
]; ];
function BayDetailController( function BayDetailController(
@@ -72,4 +72,4 @@
deleteWatcher(); deleteWatcher();
} }
} }
})(); })();

View File

@@ -19,26 +19,26 @@
/** /**
* @ngdoc overview * @ngdoc overview
* @name containersBaysTableController * @name BaysTableController
* @ngController * @ngController
* *
* @description * @description
* Controller for the containers bay table * Controller for the container-infra bay table
*/ */
angular angular
.module('horizon.dashboard.containers.bays') .module('horizon.dashboard.container-infra.bays')
.controller('containersBaysTableController', containersBaysTableController); .controller('BaysTableController', BaysTableController);
containersBaysTableController.$inject = [ BaysTableController.$inject = [
'$scope', '$scope',
'$location', '$location',
'horizon.app.core.openstack-service-api.magnum', 'horizon.app.core.openstack-service-api.magnum',
'horizon.dashboard.containers.bays.events', 'horizon.dashboard.container-infra.bays.events',
'horizon.framework.conf.resource-type-registry.service', 'horizon.framework.conf.resource-type-registry.service',
'horizon.dashboard.containers.bays.resourceType' 'horizon.dashboard.container-infra.bays.resourceType'
]; ];
function containersBaysTableController($scope, $location, magnum, events, registry, bayResourceType) { function BaysTableController($scope, $location, magnum, events, registry, bayResourceType) {
var ctrl = this; var ctrl = this;
ctrl.bays = []; ctrl.bays = [];
ctrl.baysSrc = []; ctrl.baysSrc = [];

View File

@@ -1,5 +1,5 @@
<div> <div>
<hz-magic-search-context ng-controller="containersBaysTableController as table" <hz-magic-search-context ng-controller="BaysTableController as table"
filter-facets="table.bayFacets"> filter-facets="table.bayFacets">
<hz-magic-search-bar></hz-magic-search-bar> <hz-magic-search-bar></hz-magic-search-bar>
<actions class="batch-action" allowed="table.bayResource.batchActions" type="batch"></actions> <actions class="batch-action" allowed="table.bayResource.batchActions" type="batch"></actions>
@@ -136,4 +136,4 @@
<tfoot hz-table-footer items="table.bays"></tfoot> <tfoot hz-table-footer items="table.bays"></tfoot>
</table> </table>
</hz-magic-search-context> </hz-magic-search-context>
</div> </div>

View File

@@ -19,15 +19,15 @@
/** /**
* @ngdoc overview * @ngdoc overview
* @name horizon.dashboard.containers * @name horizon.dashboard.container-infra
* *
* @description * @description
* Dashboard module to host various containers panels. * Dashboard module to host various container-infra panels.
*/ */
angular angular
.module('horizon.dashboard.containers', [ .module('horizon.dashboard.container-infra', [
'horizon.dashboard.containers.bays', 'horizon.dashboard.container-infra.bays',
'horizon.dashboard.containers.baymodels', 'horizon.dashboard.container-infra.baymodels',
'ngRoute' 'ngRoute'
]) ])
.config(config) .config(config)
@@ -36,8 +36,8 @@
'$routeProvider', '$locationProvider']; '$routeProvider', '$locationProvider'];
function config($provide, $windowProvider, $routeProvider, $locationProvider) { function config($provide, $windowProvider, $routeProvider, $locationProvider) {
var path = $windowProvider.$get().STATIC_URL + 'dashboard/containers/'; var path = $windowProvider.$get().STATIC_URL + 'dashboard/container-infra/';
$provide.constant('horizon.dashboard.containers.basePath', path); $provide.constant('horizon.dashboard.container-infra.basePath', path);
$routeProvider $routeProvider
.when('/project/baymodels', { .when('/project/baymodels', {

View File

@@ -16,9 +16,9 @@
(function() { (function() {
'use strict'; 'use strict';
describe('horizon.dashboard.containers', function() { describe('horizon.dashboard.container-infra', function() {
it('should exist', function() { it('should exist', function() {
expect(angular.module('horizon.dashboard.containers')).toBeDefined(); expect(angular.module('horizon.dashboard.container-infra')).toBeDefined();
}); });
}); });

View File

@@ -47,28 +47,28 @@
////////// //////////
function createBay(params) { function createBay(params) {
return apiService.post('/api/containers/bays/', params) return apiService.post('/api/container-infra/bays/', params)
.error(function() { .error(function() {
toastService.add('error', gettext('Unable to create Bay.')); toastService.add('error', gettext('Unable to create Bay.'));
}); });
} }
function getBay(id) { function getBay(id) {
return apiService.get('/api/containers/bays/' + id) return apiService.get('/api/container-infra/bays/' + id)
.error(function() { .error(function() {
toastService.add('error', gettext('Unable to retrieve the Bay.')); toastService.add('error', gettext('Unable to retrieve the Bay.'));
}); });
} }
function getBays() { function getBays() {
return apiService.get('/api/containers/bays/') return apiService.get('/api/container-infra/bays/')
.error(function() { .error(function() {
toastService.add('error', gettext('Unable to retrieve the Bays.')); toastService.add('error', gettext('Unable to retrieve the Bays.'));
}); });
} }
function deleteBay(id, suppressError) { function deleteBay(id, suppressError) {
var promise = apiService.delete('/api/containers/bays/', [id]); var promise = apiService.delete('/api/container-infra/bays/', [id]);
return suppressError ? promise : promise.error(function() { return suppressError ? promise : promise.error(function() {
var msg = gettext('Unable to delete the Bay with id: %(id)s'); var msg = gettext('Unable to delete the Bay with id: %(id)s');
toastService.add('error', interpolate(msg, { id: id }, true)); toastService.add('error', interpolate(msg, { id: id }, true));
@@ -77,7 +77,7 @@
// FIXME(shu-mutou): Unused for batch-delete in Horizon framework in Feb, 2016. // FIXME(shu-mutou): Unused for batch-delete in Horizon framework in Feb, 2016.
function deleteBays(ids) { function deleteBays(ids) {
return apiService.delete('/api/containers/bays/', ids) return apiService.delete('/api/container-infra/bays/', ids)
.error(function() { .error(function() {
toastService.add('error', gettext('Unable to delete the Bays.')); toastService.add('error', gettext('Unable to delete the Bays.'));
}); });
@@ -88,28 +88,28 @@
/////////////// ///////////////
function createBaymodel(params) { function createBaymodel(params) {
return apiService.post('/api/containers/baymodels/', params) return apiService.post('/api/container-infra/baymodels/', params)
.error(function() { .error(function() {
toastService.add('error', gettext('Unable to create Baymodel')); toastService.add('error', gettext('Unable to create Baymodel'));
}); });
} }
function getBaymodel(id) { function getBaymodel(id) {
return apiService.get('/api/containers/baymodels/' + id) return apiService.get('/api/container-infra/baymodels/' + id)
.error(function() { .error(function() {
toastService.add('error', gettext('Unable to retrieve the Baymodel.')); toastService.add('error', gettext('Unable to retrieve the Baymodel.'));
}); });
} }
function getBaymodels() { function getBaymodels() {
return apiService.get('/api/containers/baymodels/') return apiService.get('/api/container-infra/baymodels/')
.error(function() { .error(function() {
toastService.add('error', gettext('Unable to retrieve the Baymodels.')); toastService.add('error', gettext('Unable to retrieve the Baymodels.'));
}); });
} }
function deleteBaymodel(id, suppressError) { function deleteBaymodel(id, suppressError) {
var promise = apiService.delete('/api/containers/baymodels/', [id]); var promise = apiService.delete('/api/container-infra/baymodels/', [id]);
return suppressError ? promise : promise.error(function() { return suppressError ? promise : promise.error(function() {
var msg = gettext('Unable to delete the Baymodel with id: %(id)s'); var msg = gettext('Unable to delete the Baymodel with id: %(id)s');
toastService.add('error', interpolate(msg, { id: id }, true)); toastService.add('error', interpolate(msg, { id: id }, true));
@@ -118,7 +118,7 @@
// FIXME(shu-mutou): Unused for batch-delete in Horizon framework in Feb, 2016. // FIXME(shu-mutou): Unused for batch-delete in Horizon framework in Feb, 2016.
function deleteBaymodels(ids) { function deleteBaymodels(ids) {
return apiService.delete('/api/containers/baymodels/', ids) return apiService.delete('/api/container-infra/baymodels/', ids)
.error(function() { .error(function() {
toastService.add('error', gettext('Unable to delete the Baymodels.')); toastService.add('error', gettext('Unable to delete the Baymodels.'));
}) })

View File

@@ -48,7 +48,7 @@ class MagnumRestTestCase(test.TestCase):
self.assertStatusCode(response, 201) self.assertStatusCode(response, 201)
self.assertEqual(response['location'], self.assertEqual(response['location'],
'/api/containers/baymodel/%s' % test_bmodel.uuid) '/api/container-infra/baymodel/%s' % test_bmodel.uuid)
client.baymodel_create.assert_called_once_with(request, client.baymodel_create.assert_called_once_with(request,
**test_bmodel.to_dict()) **test_bmodel.to_dict())
@@ -87,7 +87,7 @@ class MagnumRestTestCase(test.TestCase):
self.assertStatusCode(response, 201) self.assertStatusCode(response, 201)
self.assertEqual(response['location'], self.assertEqual(response['location'],
'/api/containers/bay/%s' % test_bay.uuid) '/api/container-infra/bay/%s' % test_bay.uuid)
client.bay_create.assert_called_once_with(request, client.bay_create.assert_called_once_with(request,
**test_bay.to_dict()) **test_bay.to_dict())

View File

@@ -16,7 +16,7 @@ from openstack_dashboard.test.test_data import utils
def data(TEST): def data(TEST):
# Test Data Containers # Test Data Container in Horizon
TEST.baymodels = utils.TestDataContainer() TEST.baymodels = utils.TestDataContainer()
TEST.bays = utils.TestDataContainer() TEST.bays = utils.TestDataContainer()