Eliminate use of a now obsolete admin basePath variable
The ironic plugin was using a basePath variable provided by the dashboard.admin module. This variable appears to have been recently removed from the admin module, and actually should not have been used by ironic in the first place. The dashboard.ironic module now privides its own basePath variable. Change-Id: I3df31c5f46e99e3b4f5b45daf7f1aa11fa623b1c
This commit is contained in:
parent
83bd7d2fda
commit
9185bc06fe
@ -23,7 +23,7 @@
|
||||
|
||||
createPortService.$inject = [
|
||||
'$modal',
|
||||
'horizon.dashboard.admin.basePath'
|
||||
'horizon.dashboard.admin.ironic.basePath'
|
||||
];
|
||||
|
||||
function createPortService($modal, basePath) {
|
||||
@ -41,7 +41,7 @@
|
||||
return node;
|
||||
}
|
||||
},
|
||||
templateUrl: basePath + '/ironic/create-port/create-port.html'
|
||||
templateUrl: basePath + '/create-port/create-port.html'
|
||||
};
|
||||
return $modal.open(options);
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
editNodeService.$inject = [
|
||||
'$modal',
|
||||
'horizon.dashboard.admin.basePath',
|
||||
'horizon.dashboard.admin.ironic.basePath',
|
||||
'$log'
|
||||
];
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
return node;
|
||||
}
|
||||
},
|
||||
templateUrl: basePath + '/ironic/base-node/base-node.html'
|
||||
templateUrl: basePath + '/base-node/base-node.html'
|
||||
};
|
||||
return $modal.open(options);
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
enrollNodeService.$inject = [
|
||||
'$modal',
|
||||
'horizon.dashboard.admin.basePath'
|
||||
'horizon.dashboard.admin.ironic.basePath'
|
||||
];
|
||||
|
||||
function enrollNodeService($modal, basePath) {
|
||||
@ -35,7 +35,7 @@
|
||||
var options = {
|
||||
controller: 'EnrollNodeController as ctrl',
|
||||
backdrop: 'static',
|
||||
templateUrl: basePath + '/ironic/base-node/base-node.html'
|
||||
templateUrl: basePath + '/base-node/base-node.html'
|
||||
};
|
||||
return $modal.open(options);
|
||||
}
|
||||
|
@ -27,21 +27,27 @@
|
||||
*/
|
||||
angular
|
||||
.module('horizon.dashboard.admin.ironic', [])
|
||||
.constant('horizon.dashboard.admin.ironic.validHostNamePattern',
|
||||
'^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$') // eslint-disable-line max-len
|
||||
.config(config);
|
||||
|
||||
.constant('horizon.dashboard.admin.ironic.validUuidPattern',
|
||||
'^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$') // eslint-disable-line max-len
|
||||
.constant('horizon.dashboard.admin.ironic.events', events());
|
||||
config.$inject = ['$provide', '$windowProvider'];
|
||||
|
||||
function events() {
|
||||
return {
|
||||
function config($provide, $windowProvider) {
|
||||
$provide.constant('horizon.dashboard.admin.ironic.validHostNamePattern',
|
||||
'^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$'); // eslint-disable-line max-len
|
||||
|
||||
$provide.constant('horizon.dashboard.admin.ironic.validUuidPattern',
|
||||
'^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$'); // eslint-disable-line max-len
|
||||
|
||||
var path = $windowProvider.$get().STATIC_URL + 'dashboard/admin/ironic/';
|
||||
$provide.constant('horizon.dashboard.admin.ironic.basePath', path);
|
||||
|
||||
var events = {
|
||||
ENROLL_NODE_SUCCESS:'horizon.dashboard.admin.ironic.ENROLL_NODE_SUCCESS',
|
||||
DELETE_NODE_SUCCESS:'horizon.dashboard.admin.ironic.DELETE_NODE_SUCCESS',
|
||||
EDIT_NODE_SUCCESS:'horizon.dashboard.admin.ironic.EDIT_NODE_SUCCESS',
|
||||
CREATE_PORT_SUCCESS:'horizon.dashboard.admin.ironic.CREATE_PORT_SUCCESS',
|
||||
DELETE_PORT_SUCCESS:'horizon.dashboard.admin.ironic.DELETE_PORT_SUCCESS'
|
||||
};
|
||||
$provide.constant('horizon.dashboard.admin.ironic.events', events);
|
||||
}
|
||||
|
||||
})();
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
maintenanceService.$inject = [
|
||||
'$modal',
|
||||
'horizon.dashboard.admin.basePath',
|
||||
'horizon.dashboard.admin.ironic.basePath',
|
||||
'horizon.dashboard.admin.ironic.actions'
|
||||
];
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
function putNodeInMaintenanceMode(node) {
|
||||
var options = {
|
||||
controller: "MaintenanceController as ctrl",
|
||||
templateUrl: basePath + '/ironic/maintenance/maintenance.html'
|
||||
templateUrl: basePath + '/maintenance/maintenance.html'
|
||||
};
|
||||
$modal.open(options).result.then(function(maintReason) {
|
||||
actions.putNodeInMaintenanceMode(node, maintReason);
|
||||
@ -72,7 +72,7 @@
|
||||
function putNodesInMaintenanceMode(nodes) {
|
||||
var options = {
|
||||
controller: "MaintenanceController as ctrl",
|
||||
templateUrl: basePath + '/ironic/maintenance/maintenance.html'
|
||||
templateUrl: basePath + '/maintenance/maintenance.html'
|
||||
};
|
||||
$modal.open(options).result.then(function(maintReason) {
|
||||
actions.putAllInMaintenanceMode(nodes, maintReason);
|
||||
|
@ -30,7 +30,7 @@
|
||||
'horizon.app.core.openstack-service-api.ironic',
|
||||
'horizon.dashboard.admin.ironic.events',
|
||||
'horizon.dashboard.admin.ironic.actions',
|
||||
'horizon.dashboard.admin.basePath',
|
||||
'horizon.dashboard.admin.ironic.basePath',
|
||||
'horizon.dashboard.admin.ironic.edit-node.service',
|
||||
'horizon.dashboard.admin.ironic.maintenance.service',
|
||||
'horizon.dashboard.admin.ironic.validUuidPattern'
|
||||
@ -48,7 +48,7 @@
|
||||
maintenanceService,
|
||||
validUuidPattern) {
|
||||
var ctrl = this;
|
||||
var path = basePath + 'ironic/node-details/sections/';
|
||||
var path = basePath + '/node-details/sections/';
|
||||
|
||||
ctrl.noPortsText = gettext('No network ports have been defined');
|
||||
|
||||
|
@ -29,7 +29,6 @@
|
||||
'horizon.app.core.openstack-service-api.ironic',
|
||||
'horizon.dashboard.admin.ironic.events',
|
||||
'horizon.dashboard.admin.ironic.actions',
|
||||
'horizon.dashboard.admin.basePath',
|
||||
'horizon.dashboard.admin.ironic.maintenance.service',
|
||||
'horizon.dashboard.admin.ironic.enroll-node.service',
|
||||
'horizon.dashboard.admin.ironic.edit-node.service'
|
||||
@ -42,7 +41,6 @@
|
||||
ironic,
|
||||
ironicEvents,
|
||||
actions,
|
||||
basePath,
|
||||
maintenanceService,
|
||||
enrollNodeService,
|
||||
editNodeService) {
|
||||
@ -50,7 +48,6 @@
|
||||
|
||||
ctrl.nodes = [];
|
||||
ctrl.nodesSrc = [];
|
||||
ctrl.basePath = basePath;
|
||||
ctrl.actions = actions;
|
||||
|
||||
ctrl.putNodeInMaintenanceMode = putNodeInMaintenanceMode;
|
||||
|
Loading…
x
Reference in New Issue
Block a user