Merge "Fix issue where qos delete action returns error message"

This commit is contained in:
Zuul 2018-08-17 08:55:52 +00:00 committed by Gerrit Code Review
commit 122bbcace9
3 changed files with 31 additions and 0 deletions

View File

@ -1967,6 +1967,12 @@ def policy_get(request, policy_id, **kwargs):
return QoSPolicy(policy)
@profiler.trace
def policy_delete(request, policy_id):
"""Delete QoS policy for a given policy id."""
neutronclient(request).delete_qos_policy(policy_id)
@profiler.trace
def list_availability_zones(request, resource=None, state=None):
az_list = neutronclient(request).list_availability_zones().get(

View File

@ -38,6 +38,7 @@
createNetwork: createNetwork,
createSubnet: createSubnet,
createTrunk: createTrunk,
deletePolicy: deletePolicy,
deleteTrunk: deleteTrunk,
getAgents: getAgents,
getDefaultQuotaSets: getDefaultQuotaSets,
@ -390,6 +391,21 @@
});
}
/**
* @name deletePolicy
* @description
* Delete a single neutron qos policy.
* @param {string} policyId
* Specifies the id of the policy to be deleted.
*/
function deletePolicy(policyId, suppressError) {
var promise = apiService.delete('/api/neutron/qos_policies/' + policyId + '/');
promise = suppressError ? promise : promise.error(function() {
var msg = gettext('Unable to delete qos policy %(id)s');
toastService.add('error', interpolate(msg, { id: policyId }, true));
});
return promise;
}
// Trunks
/**

View File

@ -310,6 +310,15 @@
{"project_id": 1}
],
"error": "Unable to retrieve the qos policies."
},
{
"func": "deletePolicy",
"method": "delete",
"path": "/api/neutron/qos_policies/63/",
"error": "Unable to delete qos policy 63",
"testInput": [
63
]
}
];