Merge "fix: add vm state check for modify instance tags"

This commit is contained in:
Zuul 2022-09-29 11:19:50 +00:00 committed by Gerrit Code Review
commit c160574dce

View File

@ -28,7 +28,11 @@ export class ModifyTags extends ModalAction {
static policy = 'os_compute_api:os-server-tags:update_all'; static policy = 'os_compute_api:os-server-tags:update_all';
static allowed = () => Promise.resolve(true); static allowed = (item) => {
const allowedStates = ['active', 'paused', 'suspended', 'stopped'];
const { vm_state = '' } = item || {};
return Promise.resolve(allowedStates.includes(vm_state.toLowerCase()));
};
get name() { get name() {
return t('modify instance tags'); return t('modify instance tags');