From fe3c44680e7d13df05a57919b01cf324263bdc55 Mon Sep 17 00:00:00 2001 From: Maciej Strzelczyk Date: Fri, 2 Feb 2024 12:23:57 +0100 Subject: [PATCH 1/2] fix: compute template test issue --- compute/client_library/snippets/tests/test_templates.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compute/client_library/snippets/tests/test_templates.py b/compute/client_library/snippets/tests/test_templates.py index 8a4321e7773..e5076a8bdee 100644 --- a/compute/client_library/snippets/tests/test_templates.py +++ b/compute/client_library/snippets/tests/test_templates.py @@ -56,7 +56,8 @@ def test_create_template_and_list(deletable_template_name): ) assert template.properties.disks[0].initialize_params.disk_size_gb == 250 assert "debian-11" in template.properties.disks[0].initialize_params.source_image - assert template.properties.network_interfaces[0].name == "global/networks/default" + assert template.properties.network_interfaces[0].name == "nic0" + assert template.properties.network_interfaces[0].network.endswith("global/networks/default") assert template.properties.machine_type == "e2-standard-4" From dfdc718109626607189a7ee71cbf6806aa63b065 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 2 Feb 2024 11:26:59 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../client_library/ingredients/instances/create_instance.py | 6 ++++-- compute/client_library/snippets/tests/test_templates.py | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/compute/client_library/ingredients/instances/create_instance.py b/compute/client_library/ingredients/instances/create_instance.py index 1b559bd0e28..359f8427569 100644 --- a/compute/client_library/ingredients/instances/create_instance.py +++ b/compute/client_library/ingredients/instances/create_instance.py @@ -117,7 +117,9 @@ def create_instance( instance.scheduling = compute_v1.Scheduling() if accelerators: instance.guest_accelerators = accelerators - instance.scheduling.on_host_maintenance = compute_v1.Scheduling.OnHostMaintenance.TERMINATE.name + instance.scheduling.on_host_maintenance = ( + compute_v1.Scheduling.OnHostMaintenance.TERMINATE.name + ) if preemptible: # Set the preemptible setting @@ -126,7 +128,7 @@ def create_instance( ) instance.scheduling = compute_v1.Scheduling() instance.scheduling.preemptible = True - + if spot: # Set the Spot VM setting instance.scheduling.provisioning_model = ( diff --git a/compute/client_library/snippets/tests/test_templates.py b/compute/client_library/snippets/tests/test_templates.py index e5076a8bdee..a7f25d0603f 100644 --- a/compute/client_library/snippets/tests/test_templates.py +++ b/compute/client_library/snippets/tests/test_templates.py @@ -57,7 +57,9 @@ def test_create_template_and_list(deletable_template_name): assert template.properties.disks[0].initialize_params.disk_size_gb == 250 assert "debian-11" in template.properties.disks[0].initialize_params.source_image assert template.properties.network_interfaces[0].name == "nic0" - assert template.properties.network_interfaces[0].network.endswith("global/networks/default") + assert template.properties.network_interfaces[0].network.endswith( + "global/networks/default" + ) assert template.properties.machine_type == "e2-standard-4"