Send Netdot-devel mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://osl.uoregon.edu/mailman/listinfo/netdot-devel
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Netdot-devel digest..."


Today's Topics:

   1. [Netdot - Bug #1853] (New) Device inventory Model/OS      output
      not stable ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Tue, 24 Mar 2015 02:02:48 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1853] (New) Device inventory
        Model/OS        output not stable
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1853 has been reported by Petr ?ech.

----------------------------------------
Bug #1853: Device inventory Model/OS output not stable
https://osl.uoregon.edu/redmine/issues/1853

Author: Petr ?ech
Status: New
Priority: Low
Assignee: 
Category: 
Target version: 1.0.8
Resolution: 


Hi,
it seems recent perl hash changes have caused random ordering of Model/OS 
report.

I've made following patch and it seems to be working acceptably.

Regards,
Petr

<pre>
--- device_inventory.html.orig  2015-03-24 09:41:46.143857376 +0100
+++ device_inventory.html       2015-03-24 09:57:32.196742214 +0100
@@ -198,7 +198,7 @@
 
     @headers = ( 'Manufacturer', 'Model', 'OS', 'Count', );
     my @row = ();
-    foreach my $m ( keys %t ){
+    foreach my $m ( sort { Entity->retrieve($a)->name cmp 
Entity->retrieve($b)->name } keys %t ){
        my @row = ();
        my $entity;
        if ( $m ne 'Unset' && ($entity = Entity->retrieve($m)) ){
@@ -208,7 +208,7 @@
        }
        push ( @row, " ", " ", "<b>$t{$m}{total}</b>" );
        push( @rows, \@row );
-       foreach my $prod ( keys %{$t{$m}{product}} ){
+       foreach my $prod ( sort { Product->retrieve($a)->name cmp 
Product->retrieve($b)->name } keys %{$t{$m}{product}} ){
            my @row = ();
            push( @row, " " );
            my $product;
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


------------------------------

_______________________________________________
Netdot-devel mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-devel


End of Netdot-devel Digest, Vol 96, Issue 3
*******************************************

Reply via email to