@@ -47,3 +47,32 @@ def test_subnet_list(self):
4747 vlan_mock .return_value = getObject
4848 result = self .run_command (['vlan' , 'detail' , '1234' ])
4949 self .assert_no_fail (result )
50+
51+ def test_detail_hardware_without_hostname (self ):
52+ vlan_mock = self .set_mock ('SoftLayer_Network_Vlan' , 'getObject' )
53+ getObject = {
54+ 'primaryRouter' : {
55+ 'datacenter' : {'id' : 1234 , 'longName' : 'TestDC' },
56+ 'fullyQualifiedDomainName' : 'fcr01.TestDC'
57+ },
58+ 'id' : 1234 ,
59+ 'vlanNumber' : 4444 ,
60+ 'firewallInterfaces' : None ,
61+ 'subnets' : [],
62+ 'hardware' : [
63+ {'a_hardware' : 'that_has_none_of_the_expected_attributes_provided' },
64+ {'domain' : 'example.com' ,
65+ 'networkManagementIpAddress' : '10.171.202.131' ,
66+ 'hardwareStatus' : {'status' : 'ACTIVE' , 'id' : 5 },
67+ 'notes' : '' ,
68+ 'hostname' : 'hw1' , 'hardwareStatusId' : 5 ,
69+ 'globalIdentifier' : 'f6ea716a-41d8-4c52-bb2e-48d63105f4b0' ,
70+ 'primaryIpAddress' : '169.60.169.169' ,
71+ 'primaryBackendIpAddress' : '10.171.202.130' , 'id' : 826425 ,
72+ 'privateIpAddress' : '10.171.202.130' ,
73+ 'fullyQualifiedDomainName' : 'hw1.example.com' }
74+ ]
75+ }
76+ vlan_mock .return_value = getObject
77+ result = self .run_command (['vlan' , 'detail' , '1234' ])
78+ self .assert_no_fail (result )
0 commit comments