Hello

I noticed that when running kickstart_export from spacecmd, the various
lists that end up in the resulting json file are not sorted so every
time one runs the command, the resulting json file end up looking
different, i.e. the items have a different order. 
This would normally (I guess) not be a problem but what I'm trying to
accomplish is version control of the kickstart profiles, i.e. checking
in the json files into an external SVN repository. And then, the
unstable ordering suddenly becomes a problem...
The attached patch (against spacecmd-1.8.15), solves the problem by
sorting the lists right after they've been fetched from the API, but I
guess json_dump_to_file() in utils.py  might be a better (more generic)
place to fix this in.

-- 
David Juran
Sr. Consultant
Red Hat
+46-725-345801
--- kickstart.py.orig	2013-02-15 16:02:53.000000000 +0100
+++ kickstart.py	2013-02-15 16:45:21.000000000 +0100
@@ -1926,6 +1926,11 @@
         logging.debug("Post kernel options %s detected" % post_kopts)
         details['post_kopts'] = post_kopts
 
+    #and now sort all the lists
+    for i in details.keys():
+        if isinstance(details[i],list):
+            details[i].sort()
+
     return details
 
 def do_kickstart_export(self, args):

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to