diff --git a/SoftLayer/CLI/dedicatedhost/list_guests.py b/SoftLayer/CLI/dedicatedhost/list_guests.py index 6d263941d..5d8f2c3bc 100644 --- a/SoftLayer/CLI/dedicatedhost/list_guests.py +++ b/SoftLayer/CLI/dedicatedhost/list_guests.py @@ -8,6 +8,7 @@ from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers +from SoftLayer import utils COLUMNS = [ column_helper.Column('guid', ('globalIdentifier',)), @@ -18,7 +19,8 @@ column_helper.Column('backend_ip', ('primaryBackendIpAddress',)), column_helper.Column( 'created_by', - ('billingItem', 'orderItem', 'order', 'userRecord', 'username')), + lambda created_by: utils.lookup(created_by, 'billingItem', 'orderItem', 'order', 'userRecord', 'username'), + mask='billingItem[id,orderItem[id,order[id,userRecord[username]]]]'), column_helper.Column('power_state', ('powerState', 'name')), column_helper.Column( 'tags', diff --git a/SoftLayer/CLI/hardware/list.py b/SoftLayer/CLI/hardware/list.py index 42b298155..734f379d4 100644 --- a/SoftLayer/CLI/hardware/list.py +++ b/SoftLayer/CLI/hardware/list.py @@ -8,6 +8,7 @@ from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers +from SoftLayer import utils # pylint: disable=unnecessary-lambda @@ -22,7 +23,8 @@ mask='activeTransaction[id, transactionStatus[name, friendlyName]]'), column_helper.Column( 'created_by', - ('billingItem', 'orderItem', 'order', 'userRecord', 'username')), + lambda created_by: utils.lookup(created_by, 'billingItem', 'orderItem', 'order', 'userRecord', 'username'), + mask='billingItem[id,orderItem[id,order[id,userRecord[username]]]]'), column_helper.Column( 'tags', lambda server: formatting.tags(server.get('tagReferences')), diff --git a/SoftLayer/CLI/virt/list.py b/SoftLayer/CLI/virt/list.py index b16d5602f..d30b4ff6a 100644 --- a/SoftLayer/CLI/virt/list.py +++ b/SoftLayer/CLI/virt/list.py @@ -21,7 +21,9 @@ column_helper.Column('action', lambda guest: formatting.active_txn(guest), mask='activeTransaction[id,transactionStatus[name,friendlyName]]'), column_helper.Column('power_state', ('powerState', 'name')), - column_helper.Column('created_by', ('billingItem', 'orderItem', 'order', 'userRecord', 'username')), + column_helper.Column('created_by', lambda created_by: + utils.lookup(created_by, 'billingItem', 'orderItem', 'order', 'userRecord', 'username'), + mask='billingItem[id,orderItem[id,order[id,userRecord[username]]]]'), column_helper.Column('tags', lambda server: formatting.tags(server.get('tagReferences')), mask="tagReferences.tag.name"), column_helper.Column(