From 80a965de712f36f598bf1092f0c0a9e5837f7121 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Mon, 4 Nov 2019 15:58:37 -0600 Subject: [PATCH 1/2] #1181 fixed issue where vs reboot was using the hardware manager, and not the VS manager to resolve ids --- SoftLayer/CLI/virt/power.py | 2 +- tests/CLI/modules/autoscale_tests.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/SoftLayer/CLI/virt/power.py b/SoftLayer/CLI/virt/power.py index f3c04a9b7..20f73d04f 100644 --- a/SoftLayer/CLI/virt/power.py +++ b/SoftLayer/CLI/virt/power.py @@ -35,7 +35,7 @@ def reboot(env, identifier, hard): """Reboot an active virtual server.""" virtual_guest = env.client['Virtual_Guest'] - mgr = SoftLayer.HardwareManager(env.client) + mgr = SoftLayer.VSManager(env.client) vs_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'VS') if not (env.skip_confirmations or formatting.confirm('This will reboot the VS with id %s. ' diff --git a/tests/CLI/modules/autoscale_tests.py b/tests/CLI/modules/autoscale_tests.py index 9ea7ebe46..5d178c5e7 100644 --- a/tests/CLI/modules/autoscale_tests.py +++ b/tests/CLI/modules/autoscale_tests.py @@ -74,6 +74,9 @@ def test_autoscale_edit_userdata(self, manager): @mock.patch('SoftLayer.managers.autoscale.AutoScaleManager.edit') def test_autoscale_edit_userfile(self, manager): + # On windows, python cannot edit a NamedTemporaryFile. + if(sys.platform.startswith("win")): + self.skipTest("Test doesn't work in Windows") group = fixtures.SoftLayer_Scale_Group.getObject template = { 'virtualGuestMemberTemplate': group['virtualGuestMemberTemplate'] From f7c508021d10518b9167a302c705c9f09bc077c8 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Mon, 4 Nov 2019 16:12:40 -0600 Subject: [PATCH 2/2] tox fixes --- SoftLayer/transports.py | 2 +- tests/CLI/modules/autoscale_tests.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SoftLayer/transports.py b/SoftLayer/transports.py index 8849a5c2f..297249852 100644 --- a/SoftLayer/transports.py +++ b/SoftLayer/transports.py @@ -9,6 +9,7 @@ import json import logging import re +from string import Template import time import xmlrpc.client @@ -256,7 +257,6 @@ def print_reproduceable(self, request): :param request request: Request object """ - from string import Template output = Template('''============= testing.py ============= import requests from requests.auth import HTTPBasicAuth diff --git a/tests/CLI/modules/autoscale_tests.py b/tests/CLI/modules/autoscale_tests.py index 5d178c5e7..6d0e543da 100644 --- a/tests/CLI/modules/autoscale_tests.py +++ b/tests/CLI/modules/autoscale_tests.py @@ -8,6 +8,7 @@ Tests for the autoscale cli command """ import mock +import sys from SoftLayer import fixtures from SoftLayer import testing