Add shell-type to Azure driver
This should be included to match the functionality of other cloud drivers. Change-Id: I48e0b749cb1b711758997609e14d7327bc7a6468
This commit is contained in:
parent
cfb2283b6d
commit
703494d53f
@ -276,6 +276,20 @@ section of the configuration.
|
||||
interpreter on Ansible >=2.8, and default to
|
||||
``/usr/bin/python2`` for earlier versions.
|
||||
|
||||
.. attr:: shell-type
|
||||
:type: str
|
||||
|
||||
The shell type of the node's default shell executable. Used by Zuul
|
||||
to set ``ansible_shell_type``. This setting should only be used
|
||||
|
||||
- For a windows image with the experimental `connection-type` ``ssh``
|
||||
in which case ``cmd`` or ``powershell`` should be set
|
||||
and reflect the node's ``DefaultShell`` configuration.
|
||||
- If the default shell is not Bourne compatible (sh), but instead
|
||||
e.g. ``csh`` or ``fish``, and the user is aware that there is a
|
||||
long-standing issue with ``ansible_shell_type`` in combination
|
||||
with ``become``
|
||||
|
||||
.. attr:: image-reference
|
||||
:type: dict
|
||||
:required:
|
||||
|
@ -35,6 +35,7 @@ class AzureProviderCloudImage(ConfigValue):
|
||||
self.key = image.get('key', zuul_public_key)
|
||||
self.image_reference = image['image-reference']
|
||||
self.python_path = image.get('python-path')
|
||||
self.shell_type = image.get('shell-type')
|
||||
self.connection_type = image.get('connection-type', 'ssh')
|
||||
self.connection_port = image.get(
|
||||
'connection-port',
|
||||
@ -63,7 +64,7 @@ class AzureProviderCloudImage(ConfigValue):
|
||||
'connection-type': str,
|
||||
'connection-port': int,
|
||||
'python-path': str,
|
||||
# TODO(corvus): shell-type
|
||||
'shell-type': str,
|
||||
}
|
||||
|
||||
|
||||
@ -77,6 +78,7 @@ class AzureProviderDiskImage(ConfigValue):
|
||||
diskimage.image_types.add('vhd')
|
||||
self.pause = bool(image.get('pause', False))
|
||||
self.python_path = image.get('python-path')
|
||||
self.shell_type = image.get('shell-type')
|
||||
self.username = image.get('username')
|
||||
self.key = image.get('key')
|
||||
self.connection_type = image.get('connection-type', 'ssh')
|
||||
@ -100,7 +102,7 @@ class AzureProviderDiskImage(ConfigValue):
|
||||
'connection-type': str,
|
||||
'connection-port': int,
|
||||
'python-path': str,
|
||||
# TODO(corvus): shell-type
|
||||
'shell-type': str,
|
||||
}
|
||||
|
||||
|
||||
|
@ -117,6 +117,7 @@ class StateMachineNodeLauncher(stats.StatsReporter):
|
||||
|
||||
self.node.username = image.username
|
||||
self.node.python_path = image.python_path
|
||||
self.node.shell_type = image.shell_type
|
||||
self.node.connection_port = image.connection_port
|
||||
self.node.connection_type = image.connection_type
|
||||
self.zk.storeNode(self.node)
|
||||
|
1
nodepool/tests/fixtures/azure.yaml
vendored
1
nodepool/tests/fixtures/azure.yaml
vendored
@ -28,6 +28,7 @@ providers:
|
||||
cloud-images:
|
||||
- name: bionic
|
||||
username: zuul
|
||||
shell-type: sh
|
||||
image-reference:
|
||||
sku: 18.04-LTS
|
||||
publisher: Canonical
|
||||
|
@ -54,6 +54,7 @@ class TestDriverAzure(tests.DBTestCase):
|
||||
self.assertEqual(node.state, zk.READY)
|
||||
self.assertIsNotNone(node.launcher)
|
||||
self.assertEqual(node.connection_type, 'ssh')
|
||||
self.assertEqual(node.shell_type, 'sh')
|
||||
self.assertEqual(node.attributes,
|
||||
{'key1': 'value1', 'key2': 'value2'})
|
||||
|
||||
@ -85,5 +86,6 @@ class TestDriverAzure(tests.DBTestCase):
|
||||
self.assertEqual(node.state, zk.READY)
|
||||
self.assertIsNotNone(node.launcher)
|
||||
self.assertEqual(node.connection_type, 'ssh')
|
||||
self.assertEqual(node.shell_type, None)
|
||||
self.assertEqual(node.attributes,
|
||||
{'key1': 'value1', 'key2': 'value2'})
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The shell-type setting has been added to the Azure driver.
|
Loading…
x
Reference in New Issue
Block a user