diff --git a/SoftLayer/CLI/formatting.py b/SoftLayer/CLI/formatting.py
index 138e5318..41556a9a 100644
--- a/SoftLayer/CLI/formatting.py
+++ b/SoftLayer/CLI/formatting.py
@@ -73,6 +73,7 @@ def format_prettytable(table):
     for i, row in enumerate(table.rows):
         for j, item in enumerate(row):
             table.rows[i][j] = format_output(item)
+
     ptable = table.prettytable()
     ptable.hrules = prettytable.FRAME
     ptable.horizontal_char = '.'
@@ -83,12 +84,15 @@ def format_prettytable(table):
 
 def format_no_tty(table):
     """Converts SoftLayer.CLI.formatting.Table instance to a prettytable."""
+
     for i, row in enumerate(table.rows):
         for j, item in enumerate(row):
             table.rows[i][j] = format_output(item, fmt='raw')
     ptable = table.prettytable()
+
     for col in table.columns:
         ptable.align[col] = 'l'
+
     ptable.hrules = prettytable.NONE
     ptable.border = False
     ptable.header = False
@@ -304,6 +308,30 @@ def __str__(self):
 
     __repr__ = __str__
 
+    # Implement sorting methods.
+    # NOTE(kmcdonald): functools.total_ordering could be used once support for
+    # Python 2.6 is dropped
+    def __eq__(self, other):
+        return self.original == getattr(other, 'original', other)
+
+    def __lt__(self, other):
+        if self.original is None:
+            return True
+
+        other_val = getattr(other, 'original', other)
+        if other_val is None:
+            return False
+        return self.original < other_val
+
+    def __gt__(self, other):
+        return not (self < other or self == other)
+
+    def __le__(self, other):
+        return self < other or self == other
+
+    def __ge__(self, other):
+        return not self < other
+
 
 def _format_python_value(value):
     """If the value has to_python() defined then return that."""
diff --git a/SoftLayer/CLI/server/list.py b/SoftLayer/CLI/server/list.py
index 03ba456e..d6f45622 100644
--- a/SoftLayer/CLI/server/list.py
+++ b/SoftLayer/CLI/server/list.py
@@ -14,7 +14,7 @@
 @click.command()
 @click.option('--sortby',
               help='Column to sort by',
-              type=click.Choice(['guid',
+              type=click.Choice(['id',
                                  'hostname',
                                  'primary_ip',
                                  'backend_ip',

unable to pipe out the `slcli server list commands`
Running `slcli server list` works fine, but it throws an error when piping to another file (or grep)

`slcli vs list` can pipe to another unix commands fine.

`slcli server list | tee /tmp/a`

    An unexpected error has occured:
    Traceback (most recent call last):
      File "/usr/local/lib/python3.4/site-packages/SoftLayer-4.0.1-py3.4.egg/SoftLayer/CLI/core.py", line 180, in main
        cli.main()
      File "/usr/local/lib/python3.4/site-packages/click/core.py", line 644, in main
        rv = self.invoke(ctx)
      File "/usr/local/lib/python3.4/site-packages/click/core.py", line 991, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/usr/local/lib/python3.4/site-packages/click/core.py", line 959, in _process_result
        **ctx.params)
      File "/usr/local/lib/python3.4/site-packages/click/core.py", line 464, in invoke
        return callback(*args, **kwargs)
      File "/usr/local/lib/python3.4/site-packages/SoftLayer-4.0.1-py3.4.egg/SoftLayer/CLI/core.py", line 162, in output_result
        output = env.fmt(result)
      File "/usr/local/lib/python3.4/site-packages/SoftLayer-4.0.1-py3.4.egg/SoftLayer/CLI/environment.py", line 45, in fmt
        return formatting.format_output(output, fmt=self.format)
      File "/usr/local/lib/python3.4/site-packages/SoftLayer-4.0.1-py3.4.egg/SoftLayer/CLI/formatting.py", line 38, in format_output
        return str(format_no_tty(data))
      File "/usr/local/lib/python3.4/site-packages/prettytable.py", line 237, in __str__
        return self.__unicode__()
      File "/usr/local/lib/python3.4/site-packages/prettytable.py", line 243, in __unicode__
        return self.get_string()
      File "/usr/local/lib/python3.4/site-packages/prettytable.py", line 984, in get_string
        rows = self._get_rows(options)
      File "/usr/local/lib/python3.4/site-packages/prettytable.py", line 933, in _get_rows
        rows.sort(reverse=options["reversesort"], key=options["sort_key"])
    TypeError: unorderable types: FormattedItem() < str()
    
    Feel free to report this error as it is likely a bug:
        https://github.com/softlayer/softlayer-python/issues




diff --git a/SoftLayer/testing/fixtures/SoftLayer_Account.py b/SoftLayer/testing/fixtures/SoftLayer_Account.py
index 994d5fb6..9e1a43da 100644
--- a/SoftLayer/testing/fixtures/SoftLayer_Account.py
+++ b/SoftLayer/testing/fixtures/SoftLayer_Account.py
@@ -136,7 +136,7 @@
             'friendlyName': 'Friendly Transaction Name',
             'id': 6660
         }
-    }
+    },
 }, {
     'id': 1001,
     'globalIdentifier': '1a2b3c-1702',
@@ -224,6 +224,8 @@
             'id': 19082
         },
     ]
+}, {
+    'id': 1003,
 }]
 getDomains = [{'name': 'example.com',
                'id': 12345,
diff --git a/SoftLayer/tests/CLI/helper_tests.py b/SoftLayer/tests/CLI/helper_tests.py
index 1dea9ab4..e693535a 100644
--- a/SoftLayer/tests/CLI/helper_tests.py
+++ b/SoftLayer/tests/CLI/helper_tests.py
@@ -131,6 +131,27 @@ def test_blank(self):
         self.assertEqual('-', item.formatted)
         self.assertEqual('NULL', str(item))
 
+    def test_sort_mixed(self):
+        blank = formatting.blank()
+        items = [10, blank]
+        sorted_items = sorted(items)
+        self.assertEqual(sorted_items, [blank, 10])
+
+        items = [blank, 10]
+        sorted_items = sorted(items)
+        self.assertEqual(sorted_items, [blank, 10])
+
+        items = [blank, "10"]
+        sorted_items = sorted(items)
+        self.assertEqual(sorted_items, [blank, "10"])
+
+    def test_sort(self):
+        items = [10, formatting.FormattedItem(20), formatting.FormattedItem(5)]
+        sorted_items = sorted(items)
+        self.assertEqual(sorted_items, [formatting.FormattedItem(5),
+                                        10,
+                                        formatting.FormattedItem(20)])
+
 
 class FormattedListTests(testing.TestCase):
     def test_init(self):
diff --git a/SoftLayer/tests/CLI/modules/server_tests.py b/SoftLayer/tests/CLI/modules/server_tests.py
index a65538cf..85df2f42 100644
--- a/SoftLayer/tests/CLI/modules/server_tests.py
+++ b/SoftLayer/tests/CLI/modules/server_tests.py
@@ -84,11 +84,19 @@ def test_list_servers(self):
                 'id': 1002,
                 'backend_ip': '10.1.0.4',
                 'action': None,
-            }
+            },
+            {
+                'action': None,
+                'backend_ip': None,
+                'datacenter': None,
+                'hostname': None,
+                'id': 1003,
+                'primary_ip': None,
+            },
         ]
 
         self.assertEqual(result.exit_code, 0)
-        self.assertEqual(json.loads(result.output), expected)
+        self.assertEqual(expected, json.loads(result.output))
 
     @mock.patch('SoftLayer.CLI.formatting.no_going_back')
     @mock.patch('SoftLayer.HardwareManager.reload')
diff --git a/SoftLayer/tests/managers/hardware_tests.py b/SoftLayer/tests/managers/hardware_tests.py
index 79aa5025..efec2591 100644
--- a/SoftLayer/tests/managers/hardware_tests.py
+++ b/SoftLayer/tests/managers/hardware_tests.py
@@ -78,7 +78,7 @@ def test_list_hardware_with_filters(self):
 
     def test_resolve_ids_ip(self):
         _id = self.hardware._get_ids_from_ip('172.16.1.100')
-        self.assertEqual(_id, [1000, 1001, 1002])
+        self.assertEqual(_id, [1000, 1001, 1002, 1003])
 
         _id = self.hardware._get_ids_from_ip('nope')
         self.assertEqual(_id, [])
@@ -93,7 +93,7 @@ def test_resolve_ids_ip(self):
 
     def test_resolve_ids_hostname(self):
         _id = self.hardware._get_ids_from_hostname('hardware-test1')
-        self.assertEqual(_id, [1000, 1001, 1002])
+        self.assertEqual(_id, [1000, 1001, 1002, 1003])
 
     def test_get_hardware(self):
         result = self.hardware.get_hardware(1000)

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gcc
3.6
tools/test-requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
certifi==2021.5.30
charset-normalizer==2.0.12
click==8.0.4
coverage==6.2
distlib==0.3.9
docutils==0.18.1
filelock==3.4.1
fixtures==4.0.1
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
importlib-resources==5.4.0
iniconfig==1.1.1
Jinja2==3.0.3
MarkupSafe==2.0.1
mock==5.2.0
nose==1.3.7
packaging==21.3
pbr==6.1.1
platformdirs==2.4.0
pluggy==1.0.0
prettytable==2.5.0
py==1.11.0
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
pytz==2025.2
requests==2.27.1
six==1.17.0
snowballstemmer==2.2.0
-e git+https://github.com/softlayer/softlayer-python.git@6ece88935972d6165adba9f2ea19e56020967c55#egg=SoftLayer
Sphinx==5.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
testtools==2.6.0
toml==0.10.2
tomli==1.2.3
tox==3.28.0
typing_extensions==4.1.1
urllib3==1.26.20
virtualenv==20.17.1
wcwidth==0.2.13
zipp==3.6.0

name: softlayer-python
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - click==8.0.4
      - coverage==6.2
      - distlib==0.3.9
      - docutils==0.18.1
      - filelock==3.4.1
      - fixtures==4.0.1
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - importlib-resources==5.4.0
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - markupsafe==2.0.1
      - mock==5.2.0
      - nose==1.3.7
      - packaging==21.3
      - pbr==6.1.1
      - platformdirs==2.4.0
      - pluggy==1.0.0
      - prettytable==2.5.0
      - py==1.11.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytz==2025.2
      - requests==2.27.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - testtools==2.6.0
      - toml==0.10.2
      - tomli==1.2.3
      - tox==3.28.0
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - virtualenv==20.17.1
      - wcwidth==0.2.13
      - zipp==3.6.0
prefix: /opt/conda/envs/softlayer-python

SoftLayer/tests/CLI/helper_tests.py::FormattedItemTests::test_sort SoftLayer/tests/CLI/helper_tests.py::FormattedItemTests::test_sort_mixed
SoftLayer/tests/CLI/helper_tests.py::CLIJSONEncoderTest::test_default SoftLayer/tests/CLI/helper_tests.py::CLIJSONEncoderTest::test_fail SoftLayer/tests/CLI/helper_tests.py::PromptTests::test_confirmation SoftLayer/tests/CLI/helper_tests.py::PromptTests::test_do_or_die SoftLayer/tests/CLI/helper_tests.py::FormattedItemTests::test_blank SoftLayer/tests/CLI/helper_tests.py::FormattedItemTests::test_gb SoftLayer/tests/CLI/helper_tests.py::FormattedItemTests::test_init SoftLayer/tests/CLI/helper_tests.py::FormattedItemTests::test_mb_to_gb SoftLayer/tests/CLI/helper_tests.py::FormattedListTests::test_init SoftLayer/tests/CLI/helper_tests.py::FormattedListTests::test_str SoftLayer/tests/CLI/helper_tests.py::FormattedListTests::test_to_python SoftLayer/tests/CLI/helper_tests.py::FormattedTxnTests::test_active_txn SoftLayer/tests/CLI/helper_tests.py::FormattedTxnTests::test_active_txn_empty SoftLayer/tests/CLI/helper_tests.py::FormattedTxnTests::test_active_txn_missing SoftLayer/tests/CLI/helper_tests.py::FormattedTxnTests::test_transaction_status SoftLayer/tests/CLI/helper_tests.py::FormattedTxnTests::test_transaction_status_missing SoftLayer/tests/CLI/helper_tests.py::CLIAbortTests::test_init SoftLayer/tests/CLI/helper_tests.py::ResolveIdTests::test_resolve_id_multiple SoftLayer/tests/CLI/helper_tests.py::ResolveIdTests::test_resolve_id_none SoftLayer/tests/CLI/helper_tests.py::ResolveIdTests::test_resolve_id_one SoftLayer/tests/CLI/helper_tests.py::TestFormatOutput::test_format_output_formatted_item SoftLayer/tests/CLI/helper_tests.py::TestFormatOutput::test_format_output_json SoftLayer/tests/CLI/helper_tests.py::TestFormatOutput::test_format_output_json_keyvaluetable SoftLayer/tests/CLI/helper_tests.py::TestFormatOutput::test_format_output_list SoftLayer/tests/CLI/helper_tests.py::TestFormatOutput::test_format_output_python SoftLayer/tests/CLI/helper_tests.py::TestFormatOutput::test_format_output_python_keyvaluetable SoftLayer/tests/CLI/helper_tests.py::TestFormatOutput::test_format_output_raw SoftLayer/tests/CLI/helper_tests.py::TestFormatOutput::test_format_output_string SoftLayer/tests/CLI/helper_tests.py::TestFormatOutput::test_format_output_table SoftLayer/tests/CLI/helper_tests.py::TestFormatOutput::test_sequentialoutput SoftLayer/tests/CLI/helper_tests.py::TestFormatOutput::test_unknown SoftLayer/tests/CLI/helper_tests.py::TestTemplateArgs::test_no_template_option SoftLayer/tests/CLI/helper_tests.py::TestTemplateArgs::test_template_options SoftLayer/tests/CLI/helper_tests.py::TestExportToTemplate::test_export_to_template SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_cancel_server SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_create_options SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_create_server SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_create_server_missing_required SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_create_server_test_flag SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_create_server_with_export SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_edit_server_failed SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_edit_server_userdata SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_edit_server_userdata_and_file SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_edit_server_userfile SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_list_servers SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_nic_edit_server SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_server_cancel_reasons SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_server_details SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_server_power_cycle SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_server_power_cycle_negative SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_server_power_off SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_server_power_on SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_server_reboot_default SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_server_reboot_hard SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_server_reboot_negative SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_server_reboot_soft SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_server_reload SoftLayer/tests/CLI/modules/server_tests.py::ServerCLITests::test_update_firmware SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_cancel_hardware SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_cancel_hardware_no_billing_item SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_cancel_hardware_with_reason_and_comment SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_cancel_hardware_without_reason SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_change_port_speed_private SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_change_port_speed_public SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_edit SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_edit_blank SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_edit_meta SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_generate_create_dict SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_generate_create_dict_invalid_size SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_generate_create_dict_no_items SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_generate_create_dict_no_regions SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_get_create_options SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_get_create_options_package_missing SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_get_hardware SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_init_with_ordering_manager SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_list_hardware SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_list_hardware_with_filters SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_place_order SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_reload SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_rescue SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_resolve_ids_hostname SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_resolve_ids_ip SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_update_firmware SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_update_firmware_selective SoftLayer/tests/managers/hardware_tests.py::HardwareTests::test_verify_order SoftLayer/tests/managers/hardware_tests.py::HardwareHelperTests::test_get_bandwidth_price_id_no_items SoftLayer/tests/managers/hardware_tests.py::HardwareHelperTests::test_get_default_price_id_item_not_first SoftLayer/tests/managers/hardware_tests.py::HardwareHelperTests::test_get_default_price_id_no_items SoftLayer/tests/managers/hardware_tests.py::HardwareHelperTests::test_get_extra_price_id_no_items SoftLayer/tests/managers/hardware_tests.py::HardwareHelperTests::test_get_os_price_id_no_items SoftLayer/tests/managers/hardware_tests.py::HardwareHelperTests::test_get_port_speed_price_id_no_items
SoftLayer/CLI/formatting.py SoftLayer/CLI/server/list.py
SoftLayer/CLI/formatting.py SoftLayer/CLI/server/list.py