diff --git a/launch/src/opendev_launch/launch_node.py b/launch/src/opendev_launch/launch_node.py index cd297f6d5d..6cc938ea64 100755 --- a/launch/src/opendev_launch/launch_node.py +++ b/launch/src/opendev_launch/launch_node.py @@ -131,6 +131,9 @@ def bootstrap_server(server, key, name, volume_device, keep, ssh_client = utils.ssh_connect(ip, 'root', ssh_kwargs, timeout=timeout) + if "sse4_2" not in ssh_client.ssh('cat /proc/cpuinfo', quiet=True)[1]: + raise Exception("CPU does not support x86-64-v2 (sse4_2)") + if not ignore_ipv6: # Something up with RAX images that they have the ipv6 interface in # /etc/network/interfaces but eth0 hasn't noticed yet; reload it diff --git a/launch/src/opendev_launch/sshclient.py b/launch/src/opendev_launch/sshclient.py index 2af58e7ec6..99fc01c0d6 100644 --- a/launch/src/opendev_launch/sshclient.py +++ b/launch/src/opendev_launch/sshclient.py @@ -38,14 +38,16 @@ class SSHClient(object): client.connect(ip, username=username, password=password, pkey=pkey) self.client = client - def ssh(self, command, error_ok=False): + def ssh(self, command, error_ok=False, quiet=False): stdin, stdout, stderr = self.client.exec_command(command) print('--- ssh: "%s" ---' % command) - print(' -- stdout --') + if not quiet: + print(' -- stdout --') output = '' for x in stdout: output += x - sys.stdout.write(" | " + x) + if not quiet: + sys.stdout.write(" | " + x) ret = stdout.channel.recv_exit_status() print(" -- stderr --") for x in stderr: