Skip to content

Commit 7e5d31c

Browse files
Merge pull request #1736 from caberos/issue1730
Deprecate slcli hw guests
2 parents 8248740 + d2098d3 commit 7e5d31c

File tree

7 files changed

+0
-121
lines changed

7 files changed

+0
-121
lines changed

SoftLayer/CLI/hardware/guests.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

SoftLayer/CLI/routes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@
273273
('hardware:detail', 'SoftLayer.CLI.hardware.detail:cli'),
274274
('hardware:billing', 'SoftLayer.CLI.hardware.billing:cli'),
275275
('hardware:edit', 'SoftLayer.CLI.hardware.edit:cli'),
276-
('hardware:guests', 'SoftLayer.CLI.hardware.guests:cli'),
277276
('hardware:list', 'SoftLayer.CLI.hardware.list:cli'),
278277
('hardware:power-cycle', 'SoftLayer.CLI.hardware.power:power_cycle'),
279278
('hardware:power-off', 'SoftLayer.CLI.hardware.power:power_off'),

SoftLayer/fixtures/SoftLayer_Hardware_Server.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -278,26 +278,6 @@
278278
}
279279
]
280280

281-
getVirtualHost = {
282-
"accountId": 11111,
283-
"createDate": "2018-10-08T10:54:48-06:00",
284-
"description": "host16.vmware.chechu.com",
285-
"hardwareId": 22222,
286-
"id": 33333,
287-
"name": "host16.vmware.chechu.com",
288-
"uuid": "00000000-0000-0000-0000-0cc11111",
289-
"hardware": {
290-
"accountId": 11111,
291-
"domain": "chechu.com",
292-
"hostname": "host16.vmware",
293-
"id": 22222,
294-
"hardwareStatus": {
295-
"id": 5,
296-
"status": "ACTIVE"
297-
}
298-
}
299-
}
300-
301281
getUpgradeItemPrices = [
302282
{
303283
"id": 21525,

SoftLayer/managers/hardware.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -769,18 +769,6 @@ def get_hard_drives(self, instance_id):
769769
"""
770770
return self.hardware.getHardDrives(id=instance_id)
771771

772-
def get_hardware_guests(self, instance_id):
773-
"""Returns the hardware server guests.
774-
775-
:param int instance_id: Id of the hardware server.
776-
"""
777-
mask = "mask[id]"
778-
virtual_host = self.hardware.getVirtualHost(mask=mask, id=instance_id)
779-
if virtual_host:
780-
return self.client.call('SoftLayer_Virtual_Host', 'getGuests', mask='mask[powerState]',
781-
id=virtual_host['id'])
782-
return virtual_host
783-
784772
def get_hardware_item_prices(self, location):
785773
"""Returns the hardware server item prices by location.
786774

docs/cli/hardware.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ This function updates the firmware of a server. If already at the latest version
120120
:prog: hardware storage
121121
:show-nested:
122122

123-
.. click:: SoftLayer.CLI.hardware.guests:cli
124-
:prog: hardware guests
125-
:show-nested:
126-
127123
.. click:: SoftLayer.CLI.hardware.authorize_storage:cli
128124
:prog: hardware authorize-storage
129125
:show-nested:

tests/CLI/modules/server_tests.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -910,18 +910,6 @@ def test_create_hw_no_confirm(self, confirm_mock):
910910

911911
self.assertEqual(result.exit_code, 2)
912912

913-
def test_get_hardware_guests(self):
914-
result = self.run_command(['hw', 'guests', '123456'])
915-
self.assert_no_fail(result)
916-
917-
def test_hardware_guests_empty(self):
918-
mock = self.set_mock('SoftLayer_Virtual_Host', 'getGuests')
919-
mock.return_value = None
920-
921-
result = self.run_command(['hw', 'guests', '123456'])
922-
self.assertEqual(result.exit_code, 2)
923-
self.assertIsInstance(result.exception, exceptions.CLIAbort)
924-
925913
@mock.patch('SoftLayer.CLI.formatting.confirm')
926914
def test_authorize_hw_no_confirm(self, confirm_mock):
927915
confirm_mock.return_value = False

tests/managers/hardware_tests.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -809,38 +809,6 @@ def test_get_hard_drive_empty(self):
809809

810810
self.assertEqual([], result)
811811

812-
def test_get_hardware_guests_empty_virtualHost(self):
813-
mock = self.set_mock('SoftLayer_Hardware_Server', 'getVirtualHost')
814-
mock.return_value = None
815-
816-
result = self.hardware.get_hardware_guests(1234)
817-
818-
self.assertEqual(None, result)
819-
820-
def test_get_hardware_guests(self):
821-
mock = self.set_mock('SoftLayer_Virtual_Host', 'getGuests')
822-
mock.return_value = [
823-
{
824-
"accountId": 11111,
825-
"hostname": "NSX-T Manager",
826-
"id": 22222,
827-
"maxCpu": 16,
828-
"maxCpuUnits": "CORE",
829-
"maxMemory": 49152,
830-
"powerState": {
831-
"keyName": "RUNNING",
832-
"name": "Running"
833-
},
834-
"status": {
835-
"keyName": "ACTIVE",
836-
"name": "Active"
837-
}
838-
}]
839-
840-
result = self.hardware.get_hardware_guests(1234)
841-
842-
self.assertEqual("NSX-T Manager", result[0]['hostname'])
843-
844812
def test_authorize_storage(self):
845813
options = self.hardware.authorize_storage(1234, "SL01SEL301234-11")
846814

0 commit comments

Comments
 (0)