Skip to content

Commit

Permalink
Merge pull request #537 from sudorandom/issue-536
Browse files Browse the repository at this point in the history
Uses ids over guids
  • Loading branch information
jasonjohnson committed Apr 28, 2015
2 parents f6722dc + a3576b7 commit fa58330
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
6 changes: 2 additions & 4 deletions SoftLayer/CLI/server/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def cli(env, sortby, cpu, domain, datacenter, hostname, memory, network, tag):
tags=tag)

table = formatting.Table([
'guid',
'id',
'hostname',
'primary_ip',
'backend_ip',
Expand All @@ -51,10 +51,8 @@ def cli(env, sortby, cpu, domain, datacenter, hostname, memory, network, tag):
table.sortby = sortby or 'hostname'

for server in servers:
# NOTE(kmcdonald): There are cases where a server might not have a
# globalIdentifier or hostname.
table.add_row([
utils.lookup(server, 'globalIdentifier') or server['id'],
utils.lookup(server, 'id'),
utils.lookup(server, 'hostname') or formatting.blank(),
utils.lookup(server, 'primaryIpAddress') or formatting.blank(),
utils.lookup(server, 'primaryBackendIpAddress') or
Expand Down
4 changes: 2 additions & 2 deletions SoftLayer/CLI/virt/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def cli(env, sortby, cpu, domain, datacenter, hostname, memory, network,
tags=tag_list)

table = formatting.Table([
'guid',
'id',
'hostname',
'primary_ip',
'backend_ip',
Expand All @@ -61,7 +61,7 @@ def cli(env, sortby, cpu, domain, datacenter, hostname, memory, network,

for guest in guests:
table.add_row([
utils.lookup(guest, 'globalIdentifier') or guest['id'],
utils.lookup(guest, 'id'),
utils.lookup(guest, 'hostname') or formatting.blank(),
utils.lookup(guest, 'primaryIpAddress') or formatting.blank(),
utils.lookup(guest, 'primaryBackendIpAddress') or
Expand Down
6 changes: 3 additions & 3 deletions SoftLayer/tests/CLI/modules/server_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,23 @@ def test_list_servers(self):
'datacenter': 'TEST00',
'primary_ip': '172.16.1.100',
'hostname': 'hardware-test1',
'guid': '1a2b3c-1701',
'id': 1000,
'backend_ip': '10.1.0.2',
'action': 'TXN_NAME',
},
{
'datacenter': 'TEST00',
'primary_ip': '172.16.4.94',
'hostname': 'hardware-test2',
'guid': '1a2b3c-1702',
'id': 1001,
'backend_ip': '10.1.0.3',
'action': None,
},
{
'datacenter': 'TEST00',
'primary_ip': '172.16.4.95',
'hostname': 'hardware-bad-memory',
'guid': 1002,
'id': 1002,
'backend_ip': '10.1.0.4',
'action': None,
}
Expand Down
4 changes: 2 additions & 2 deletions SoftLayer/tests/CLI/modules/vs_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ def test_list_vs(self):
'primary_ip': '172.16.240.2',
'hostname': 'vs-test1',
'action': None,
'guid': '1a2b3c-1701',
'id': 100,
'backend_ip': '10.45.19.37'},
{'datacenter': 'TEST00',
'primary_ip': '172.16.240.7',
'hostname': 'vs-test2',
'action': None,
'guid': '05a8ac-6abf0',
'id': 104,
'backend_ip': '10.45.19.35'}])

def test_detail_vs(self):
Expand Down

0 comments on commit fa58330

Please sign in to comment.