Nostate Operation
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
442 | 443 | self.time_of_suspend, self.time_of_delete = self.get_renew_times() |
443 | 444 | super(Instance, self).clean(*args, **kwargs) |
444 | 445 | |
445 | def manual_state_change(self, new_state="NOSTATE", reason=None, user=None): | |
446 | def manual_state_change(self, activity, new_state="NOSTATE", | |
Please
register
or
sign in
to reply
|
638 | 638 | register_operation(RenewOperation) |
639 | 639 | |
640 | 640 | |
641 | class ChangeStateOperation(InstanceOperation): | |
642 | activity_code_suffix = 'change_state' | |
643 | id = 'change_state' | |
644 | name = _("change state") | |
|
638 | 638 | register_operation(RenewOperation) |
639 | 639 | |
640 | 640 | |
641 | class ChangeStateOperation(InstanceOperation): | |
642 | activity_code_suffix = 'change_state' | |
643 | id = 'change_state' | |
644 | name = _("change state") | |
645 | description = _("Change the virtual machine state to NOSTATE") | |
646 | acl_level = "owner" | |
647 | required_perms = ('vm.change_state', ) | |
648 | ||
649 | def _operation(self, user, activity, new_state="NOSTATE", | |
650 | reason=None, lease=None): | |
|
514 | 515 | def get_success_url(self): |
515 | 516 | return self.get_object().get_absolute_url() + "#resources" |
516 | 517 | |
518 | def post(self, request, **kwargs): | |
|
270 | 270 | ('create_vm', _('Can create a new VM.')), |
271 | 271 | ('config_ports', _('Can configure port forwards.')), |
272 | 272 | ('recover', _('Can recover a destroyed VM.')), |
273 | ('change_state', _('Can change VM state to NOSTATE.')), | |
|
41 | 41 | |
42 | 42 | def __init__(self, activity, message=None): |
43 | 43 | if message is None: |
44 | message = ("Another activity is currently in progress: '%s'." | |
45 | % activity.activity_code) | |
44 | message = ("Another activity is currently in progress: '%s' " | |
45 | "(%s)." | |
46 | % (activity.activity_code, activity.pk)) | |
|