Beispiel #1
0
    def run(self, name):
        be = FindClone(name)
        if not be:
            raise TaskException(errno.ENOENT, 'Boot environment {0} not found'.format(name))

        if not ActivateClone(name):
            raise TaskException(errno.EIO, 'Cannot activate the {0} boot environment'.format(name))
Beispiel #2
0
        def doit():
            if 'id' in updated_params:
                if not RenameClone(id, updated_params['id']):
                    raise TaskException(errno.EIO, 'Cannot rename the {0} boot evironment'.format(id))

            if 'keep' in updated_params:
                self.run_subtask_sync('zfs.update', f'{boot_pool_name}/ROOT/{be["realname"]}', {
                    'beadm:keep': {'value': str(updated_params['keep'])}
                })

            if updated_params.get('active'):
                if not ActivateClone(id):
                    raise TaskException(errno.EIO, 'Cannot activate the {0} boot environment'.format(id))
Beispiel #3
0
def bootenv_activate(request, name):
    if request.method == 'POST':
        active = ActivateClone(name)
        if active is not False:
            return JsonResp(
                request,
                message=_('Boot Environment successfully activated.'),
            )
        return JsonResp(
            request,
            message=_('Failed to activate Boot Environment.'),
        )
    return render(request, 'system/bootenv_activate.html', {
        'name': name,
    })
Beispiel #4
0
        def doit():
            if 'id' in updated_params:
                if not RenameClone(id, updated_params['id']):
                    raise TaskException(
                        errno.EIO,
                        'Cannot rename the {0} boot evironment'.format(id))

            if 'keep' in updated_params:
                if not CloneSetAttr(be, keep=updated_params['keep']):
                    raise TaskException(
                        errno.EIO,
                        'Cannot set keep flag on boot environment {0}'.format(
                            id))

            if updated_params.get('active'):
                if not ActivateClone(id):
                    raise TaskException(
                        errno.EIO,
                        'Cannot activate the {0} boot environment'.format(id))
Beispiel #5
0
 def run(self, name):
     if not ActivateClone(name):
         raise TaskException(
             errno.EIO,
             'Cannot activate the {0} boot environment'.format(name))