Set VNC keypress rate for outputting kernel_cmd
Change-Id: I2806626e2c3ace8d3644a9ff4df36caf54295dc5 Closes-Bug: #1699631
This commit is contained in:
parent
d9facdcd97
commit
2af0a09ef5
|
@ -30,6 +30,7 @@ from devops.helpers.helpers import get_file_size
|
|||
from devops.helpers.retry import retry
|
||||
from devops.helpers import scancodes
|
||||
from devops import logger
|
||||
from devops.settings import LIBVIRT_KEYPRESS_DELAY
|
||||
|
||||
|
||||
class Snapshot(object):
|
||||
|
@ -895,14 +896,15 @@ class DevopsDriver(object):
|
|||
"""
|
||||
|
||||
key_codes = scancodes.from_string(str(keys))
|
||||
node = self.conn.lookupByUUIDString(node.uuid)
|
||||
for key_code in key_codes:
|
||||
if isinstance(key_code[0], str):
|
||||
if key_code[0] == 'wait':
|
||||
sleep(1)
|
||||
continue
|
||||
self.conn.lookupByUUIDString(node.uuid).sendKey(0, 0,
|
||||
list(key_code),
|
||||
len(key_code), 0)
|
||||
node.sendKey(0, 0, list(key_code), len(key_code), 0)
|
||||
# Limit Keypress rate with configurable delay between sending
|
||||
sleep(LIBVIRT_KEYPRESS_DELAY)
|
||||
|
||||
@retry()
|
||||
def node_set_vcpu(self, node, vcpu):
|
||||
|
|
|
@ -31,6 +31,8 @@ DRIVER_PARAMETERS = {
|
|||
'use_host_cpu': get_var_as_bool('DRIVER_USE_HOST_CPU', True),
|
||||
'enable_acpi': get_var_as_bool('DRIVER_ENABLE_ACPI', False),
|
||||
}
|
||||
LIBVIRT_KEYPRESS_DELAY = float(
|
||||
os.environ.get("LIBVIRT_KEYPRESS_DELAY", "0.05"))
|
||||
|
||||
INSTALLED_APPS = ['south', 'devops']
|
||||
|
||||
|
|
Loading…
Reference in New Issue