From 5dcc3529b336b0da89fabf04715335ee4526c9af Mon Sep 17 00:00:00 2001 From: Max Illfelder Date: Fri, 11 Nov 2016 17:59:04 -0800 Subject: [PATCH] Add "MULTI_IP_SUBNET" guestOsFeatures option. --- libcloud/compute/drivers/gce.py | 8 +++++--- .../gce/projects_coreos-cloud_global_images.json | 3 +++ libcloud/test/compute/test_gce.py | 12 ++++++++---- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py index be22d2829c..2a3beb0e56 100644 --- a/libcloud/compute/drivers/gce.py +++ b/libcloud/compute/drivers/gce.py @@ -1645,7 +1645,8 @@ class GCENodeDriver(NodeDriver): } BACKEND_SERVICE_PROTOCOLS = ['HTTP', 'HTTPS', 'HTTP2', 'TCP', 'SSL'] - GUEST_OS_FEATURES = ['VIRTIO_SCSI_MULTIQUEUE', 'WINDOWS'] + GUEST_OS_FEATURES = ['VIRTIO_SCSI_MULTIQUEUE', 'WINDOWS', + 'MULTI_IP_SUBNET'] def __init__(self, user_id, key=None, datacenter=None, project=None, auth_type=None, scopes=None, credential_file=None, **kwargs): @@ -3117,8 +3118,9 @@ def ex_create_image(self, name, volume, description=None, family=None, :keywork guest_os_features: Features of the guest operating system, valid for bootable images only. Possible - values include \'VIRTIO_SCSI_MULTIQUEUE\' - and \'WINDOWS\' if specified. + values include \'VIRTIO_SCSI_MULTIQUEUE\', + \'WINDOWS\', \'MULTI_IP_SUBNET\' if + specified. :type guest_os_features: ``list`` of ``str`` or ``None`` :keyword use_existing: If True and an image with the given name diff --git a/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_images.json b/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_images.json index 0703233015..3d9e9f8757 100644 --- a/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_images.json +++ b/libcloud/test/compute/fixtures/gce/projects_coreos-cloud_global_images.json @@ -1333,6 +1333,9 @@ }, { "type": "WINDOWS" + }, + { + "type": "MULTI_IP_SUBNET" } ], "sourceType": "RAW", diff --git a/libcloud/test/compute/test_gce.py b/libcloud/test/compute/test_gce.py index 9ec97e085f..e9a20d19c2 100644 --- a/libcloud/test/compute/test_gce.py +++ b/libcloud/test/compute/test_gce.py @@ -741,9 +741,11 @@ def test_ex_create_image(self): description = 'CoreOS beta 522.3.0' name = 'coreos' family = 'coreos' - guest_os_features = ['VIRTIO_SCSI_MULTIQUEUE', 'WINDOWS'] + guest_os_features = ['VIRTIO_SCSI_MULTIQUEUE', 'WINDOWS', + 'MULTI_IP_SUBNET'] expected_features = [ - {'type': 'VIRTIO_SCSI_MULTIQUEUE'}, {'type': 'WINDOWS'} + {'type': 'VIRTIO_SCSI_MULTIQUEUE'}, {'type': 'WINDOWS'}, + {'type': 'MULTI_IP_SUBNET'}, ] mock_request = mock.Mock() mock_request.side_effect = self.driver.connection.async_request @@ -771,9 +773,11 @@ def test_ex_copy_image(self): url = 'gs://storage.core-os.net/coreos/amd64-generic/247.0.0/coreos_production_gce.tar.gz' description = 'CoreOS beta 522.3.0' family = 'coreos' - guest_os_features = ['VIRTIO_SCSI_MULTIQUEUE', 'WINDOWS'] + guest_os_features = ['VIRTIO_SCSI_MULTIQUEUE', 'WINDOWS', + 'MULTI_IP_SUBNET'] expected_features = [ - {'type': 'VIRTIO_SCSI_MULTIQUEUE'}, {'type': 'WINDOWS'} + {'type': 'VIRTIO_SCSI_MULTIQUEUE'}, {'type': 'WINDOWS'}, + {'type': 'MULTI_IP_SUBNET'}, ] image = self.driver.ex_copy_image(name, url, description=description, family=family,