Skip to content

Commit af2c706

Browse files
tox fixes for transport things
1 parent 5a3ad54 commit af2c706

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

SoftLayer/managers/hardware.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,12 @@ def cancel_hardware(self, hardware_id, reason='unneeded', comment='', immediate=
7878
reasons = self.get_cancellation_reasons()
7979
cancel_reason = reasons.get(reason, reasons['unneeded'])
8080
ticket_mgr = SoftLayer.TicketManager(self.client)
81-
mask = 'mask[id, hourlyBillingFlag, billingItem[id], openCancellationTicket[id]]'
81+
mask = 'mask[id, hourlyBillingFlag, billingItem[id], openCancellationTicket[id], activeTransaction]'
8282
hw_billing = self.get_hardware(hardware_id, mask=mask)
8383

84+
if 'activeTransaction' in hw_billing:
85+
raise SoftLayer.SoftLayerError("Unable to cancel hardware with running transaction")
86+
8487
if 'billingItem' not in hw_billing:
8588
raise SoftLayer.SoftLayerError("Ticket #%s already exists for this server" %
8689
hw_billing['openCancellationTicket']['id'])

SoftLayer/transports.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
LOGGER = logging.getLogger(__name__)
2323
# transports.Request does have a lot of instance attributes. :(
24-
# pylint: disable=too-many-instance-attributes
24+
# pylint: disable=too-many-instance-attributes, no-self-use
2525

2626
__all__ = [
2727
'Request',
@@ -486,7 +486,7 @@ def get_last_calls(self):
486486

487487
def print_reproduceable(self, call):
488488
"""Not Implemented"""
489-
return "Not Implemented"
489+
return call.service
490490

491491

492492
class FixtureTransport(object):
@@ -505,7 +505,7 @@ def __call__(self, call):
505505

506506
def print_reproduceable(self, call):
507507
"""Not Implemented"""
508-
return "Not Implemented"
508+
return call.service
509509

510510

511511
def _proxies_dict(proxy):

tests/managers/vs_tests.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -809,19 +809,6 @@ def test_active_provision_pending(self, _now, _sleep):
809809
_sleep.assert_has_calls([mock.call(0)])
810810
self.assertFalse(value)
811811

812-
def test_active_reload(self):
813-
# actively running reload
814-
self.guestObject.side_effect = [
815-
{'activeTransaction': {'id': 1}},
816-
{
817-
'activeTransaction': {'id': 1},
818-
'provisionDate': 'aaa',
819-
'lastOperatingSystemReload': {'id': 1},
820-
},
821-
]
822-
value = self.vs.wait_for_ready(1, 0)
823-
self.assertFalse(value)
824-
825812
def test_reload_no_pending(self):
826813
# reload complete, maintance transactions
827814
self.guestObject.return_value = {

0 commit comments

Comments
 (0)