summary refs log tree commit diff stats
path: root/scripts/qmp/qemu-ga-client
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/qmp/qemu-ga-client')
-rwxr-xr-xscripts/qmp/qemu-ga-client10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/qmp/qemu-ga-client b/scripts/qmp/qemu-ga-client
index 7d2a472094..976e69e05f 100755
--- a/scripts/qmp/qemu-ga-client
+++ b/scripts/qmp/qemu-ga-client
@@ -36,10 +36,12 @@
 # See also: https://wiki.qemu.org/Features/QAPI/GuestAgent
 #
 
+from __future__ import print_function
+from __future__ import absolute_import
 import base64
 import random
 
-import qmp
+from . import qmp
 
 
 class QemuGuestAgent(qmp.QEMUMonitorProtocol):
@@ -135,7 +137,7 @@ class QemuGuestAgentClient:
 
     def fsfreeze(self, cmd):
         if cmd not in ['status', 'freeze', 'thaw']:
-            raise StandardError('Invalid command: ' + cmd)
+            raise Exception('Invalid command: ' + cmd)
 
         return getattr(self.qga, 'fsfreeze' + '_' + cmd)()
 
@@ -144,7 +146,7 @@ class QemuGuestAgentClient:
 
     def suspend(self, mode):
         if mode not in ['disk', 'ram', 'hybrid']:
-            raise StandardError('Invalid mode: ' + mode)
+            raise Exception('Invalid mode: ' + mode)
 
         try:
             getattr(self.qga, 'suspend' + '_' + mode)()
@@ -155,7 +157,7 @@ class QemuGuestAgentClient:
 
     def shutdown(self, mode='powerdown'):
         if mode not in ['powerdown', 'halt', 'reboot']:
-            raise StandardError('Invalid mode: ' + mode)
+            raise Exception('Invalid mode: ' + mode)
 
         try:
             self.qga.shutdown(mode=mode)