Skip to content

Commit

Permalink
Update sorted command in PopulatePatchesByPackage
Browse files Browse the repository at this point in the history
Update the "sorted" command for the namespaces to properly compare the
length by importing and using the 'cmp_to_key' function.

Change-Id: I0ba95e74c690e06ada35f35be568b9a5ab870c5a
  • Loading branch information
josephsnyder committed Oct 15, 2019
1 parent f5faea3 commit cb9cd7f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Scripts/PopulatePatchesByPackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# limitations under the License.
#---------------------------------------------------------------------------
from __future__ import with_statement
from functools import cmp_to_key
import sys
import os
import csv
Expand Down Expand Up @@ -147,7 +148,7 @@ def populate(input):
place(src,dest)

# Map by package namespace (prefix).
for ns in sorted(list(namespaces.keys()),order_long_to_short):
for ns in sorted(list(namespaces.keys()), key=cmp_to_key(order_long_to_short)):
path = namespaces[ns]
nsPatchList = [x.installName for x in patchList if x.namespace==ns]
for patch in nsPatchList:
Expand Down

0 comments on commit cb9cd7f

Please sign in to comment.