Please review pull request #449: Ticket/2.7.x/12349 order module list output opened by (mmrobins)

Description:

This is necessary both for consistency for the user, and so that tests
pass every time. An acceptance test that passed when I ran it did not
when CI ran it because the output order was different. This fixes that.

  • Opened: Thu Feb 02 23:12:01 UTC 2012
  • Based on: puppetlabs:2.7.x (090b8b1f8467892995e52fe9dd282e0c68315773)
  • Requested merge: mmrobins:ticket/2.7.x/12349-order_module_list_output (de58c0bc0c51ef5495b4a2dbbfa94a8c9c8c44fb)

Diff follows:

diff --git a/acceptance/tests/modules/list.rb b/acceptance/tests/modules/list.rb
index 3cc2073..28b9cef 100644
--- a/acceptance/tests/modules/list.rb
+++ b/acceptance/tests/modules/list.rb
@@ -3,9 +3,9 @@
 step "Run puppet module list"
 expected_stdout = <<-HEREDOC
 /opt/puppet-git-repos/puppet/acceptance/tests/modules/fake_modulepath
-  mysql (0.0.0)
   apache (0.0.3)
   bacula (0.0.2)
+  mysql (0.0.0)
   sqlite (0.0.1.1)
   HEREDOC
 
diff --git a/lib/puppet/face/module/list.rb b/lib/puppet/face/module/list.rb
index fae4060..e05d170 100644
--- a/lib/puppet/face/module/list.rb
+++ b/lib/puppet/face/module/list.rb
@@ -67,7 +67,7 @@
 
       modules_by_path.each do |path, modules|
         output << "#{path}\n"
-        modules.each do |mod|
+        modules.sort_by {|mod| mod.name }.each do |mod|
           version_string = mod.version ? "(#{mod.version})" : ''
           output << "  #{mod.name} #{version_string}\n"
         end

    

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to