Fix default python paths in aws, azure, ibmvpc drivers

The python-path value should default to "auto" per documentation
and to match other drivers.  Correct that.

Change-Id: Ie8254e10d9c4d8ff8f8f298fac32140a18248293
This commit is contained in:
James E. Blair 2022-04-12 06:32:41 -07:00
parent 46e130fe1a
commit daa4e39a0d
6 changed files with 11 additions and 6 deletions

View File

@ -31,7 +31,7 @@ class AwsProviderCloudImage(ConfigValue):
self.name = image['name']
self.username = image['username']
self.image_id = image.get('image-id')
self.python_path = image.get('python-path')
self.python_path = image.get('python-path', 'auto')
self.shell_type = image.get('shell-type')
self.connection_type = image.get('connection-type', 'ssh')
self.connection_port = image.get(
@ -89,7 +89,7 @@ class AwsProviderDiskImage(ConfigValue):
self.name = image['name']
diskimage.image_types.add(image_type)
self.pause = bool(image.get('pause', False))
self.python_path = image.get('python-path')
self.python_path = image.get('python-path', 'auto')
self.shell_type = image.get('shell-type')
self.username = image.get('username')
self.connection_type = image.get('connection-type', 'ssh')

View File

@ -39,7 +39,7 @@ class AzureProviderCloudImage(ConfigValue):
self.image_reference = image.get('image-reference')
self.image_filter = image.get('image-filter')
self.image_id = image.get('image-id')
self.python_path = image.get('python-path')
self.python_path = image.get('python-path', 'auto')
self.shell_type = image.get('shell-type')
self.connection_type = image.get('connection-type', 'ssh')
self.connection_port = image.get(
@ -100,7 +100,7 @@ class AzureProviderDiskImage(ConfigValue):
self.name = image['name']
diskimage.image_types.add('vhd')
self.pause = bool(image.get('pause', False))
self.python_path = image.get('python-path')
self.python_path = image.get('python-path', 'auto')
self.shell_type = image.get('shell-type')
self.username = image.get('username')
self.password = image.get('password')

View File

@ -36,7 +36,7 @@ class IBMVPCProviderCloudImage(ConfigValue):
self.image_id = image.get('image-id')
self.image_name = image.get('image-name')
self.image_filter = image.get('image-filter')
self.python_path = image.get('python-path')
self.python_path = image.get('python-path', 'auto')
self.shell_type = image.get('shell-type')
self.connection_type = image.get('connection-type', 'ssh')
self.connection_port = image.get(
@ -97,7 +97,7 @@ class IBMVPCProviderDiskImage(ConfigValue):
self.name = image['name']
diskimage.image_types.add(image_type)
self.pause = bool(image.get('pause', False))
self.python_path = image.get('python-path')
self.python_path = image.get('python-path', 'auto')
self.shell_type = image.get('shell-type')
self.username = diskimage.username
self.connection_type = image.get('connection-type', 'ssh')

View File

@ -189,6 +189,7 @@ class TestDriverAws(tests.DBTestCase):
self.assertEqual(node.public_ipv4, node.interface_ip)
self.assertTrue(node.private_ipv4.startswith('203.0.113.'))
self.assertFalse(node.public_ipv4.startswith('203.0.113.'))
self.assertEqual(node.python_path, 'auto')
instance = self.ec2.Instance(node.external_id)
response = instance.describe_attribute(Attribute='ebsOptimized')

View File

@ -87,6 +87,7 @@ class TestDriverAzure(tests.DBTestCase):
self.assertEqual(node.attributes,
{'key1': 'value1', 'key2': 'value2'})
self.assertEqual(node.host_keys, ['ssh-rsa FAKEKEY'])
self.assertEqual(node.python_path, 'auto')
self.assertEqual(
self.fake_azure.crud['Microsoft.Compute/virtualMachines'].
items[0]['properties']['osProfile']['customData'],
@ -127,6 +128,7 @@ class TestDriverAzure(tests.DBTestCase):
self.assertEqual(node.shell_type, None)
self.assertEqual(node.attributes,
{'key1': 'value1', 'key2': 'value2'})
self.assertEqual(node.python_path, 'auto')
def test_azure_external_image(self):
configfile = self.setup_config(

View File

@ -94,6 +94,7 @@ class TestDriverIBMVPC(tests.DBTestCase):
self.assertIsNotNone(node.launcher)
self.assertEqual(node.connection_type, 'ssh')
self.assertEqual(node.host_keys, [])
self.assertEqual(node.python_path, 'auto')
node.state = zk.USED
self.zk.storeNode(node)
@ -120,6 +121,7 @@ class TestDriverIBMVPC(tests.DBTestCase):
self.assertIsNotNone(node.launcher)
self.assertEqual(node.connection_type, 'ssh')
self.assertEqual(node.host_keys, ['ssh-rsa FAKEKEY'])
self.assertEqual(node.python_path, 'auto')
node.state = zk.USED
self.zk.storeNode(node)