Commit 8a224f1d authored by Antoine Millet's avatar Antoine Millet
Browse files

Allow to rescue/unrescue while VM is started

parent 94c0df4a
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -261,9 +261,6 @@ class CliHandler(RegisteredCCHandler):
            if obj['r'] != 'vm':
                errs.error(obj['id'], 'bad role')
                continue
            elif obj['status'] != 'stopped':
                errs.error(obj['id'], 'VM must be stopped')
                continue
            try:
                hvcon = self.server.get_client(obj['p'])
            except KeyError:
@@ -274,7 +271,10 @@ class CliHandler(RegisteredCCHandler):
                except Exception as err:
                    errs.error(obj['id'], 'Unexpected exception: %s' % str(err))
                else:
                    if obj['status'] == 'stopped':
                        errs.success(obj['id'], 'vm now in rescue mode')
                    else:
                        errs.success(obj['id'], 'vm will be in rescue mode after a restart')

        return errs.get_dict()

@@ -292,9 +292,6 @@ class CliHandler(RegisteredCCHandler):
            if obj['r'] != 'vm':
                errs.error(obj['id'], 'bad role')
                continue
            elif obj['status'] != 'stopped':
                errs.error(obj['id'], 'VM must be stopped')
                continue
            try:
                hvcon = self.server.get_client(obj['p'])
            except KeyError:
@@ -305,7 +302,10 @@ class CliHandler(RegisteredCCHandler):
                except Exception as err:
                    errs.error(obj['id'], 'Unexpected exception: %s' % str(err))
                else:
                    if obj['status'] == 'stopped':
                        errs.success(obj['id'], 'vm now in normal mode')
                    else:
                        errs.success(obj['id'], 'vm will be in normal mode after a restart')

        return errs.get_dict()