ncsa / puppetserver-enc

Setup and manage a database to use for Puppet External Node Classifier
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

list output in sorted order #2

Closed billglick closed 3 years ago

billglick commented 3 years ago

Can the logic in def do_list(): return the list sorted alphanumerically by default?

It currently appears to output the list of hosts in the order that the hosts were added to the ENC. e.g.

[user@asd-pup ~]$ sudo -i enc_adm -l
fqdn                        environment                role                site
--------------------------  -------------------------  ------------------  -------
asd-pup-client01.localhost  production                 default             default
asd-pup.localhost           production                 puppet_master       default
proxy02.localhost           production                 default             default
mysql-admin3.localhost      topic_svc27_mysql_cluster  mysql_orchestrator  default
mysql-admin2.localhost      topic_svc27_mysql_cluster  mysql_orchestrator  default
mysql-admin1.localhost      topic_svc27_mysql_cluster  mysql_orchestrator  default

Sorting the list of hosts alphanumerically would make the output much friendlier. If there is a need to have it sorted in a different order, that could be added as a parameter, but it doesn't seem necessary to me.