Blob Blame History Raw
diff -up authconfig-6.2.8/shvfile.py.sort authconfig-6.2.8/shvfile.py
--- authconfig-6.2.8/shvfile.py.sort	2013-11-01 16:08:01.000000000 +0100
+++ authconfig-6.2.8/shvfile.py	2016-06-16 14:32:59.534957324 +0200
@@ -95,7 +95,7 @@ class SHVFile:
 	def write(self, perms):
 		if not self.f:
 			try:
-				fd = os.open(self.filename, os.O_RDWR | os.O_CREAT, perms)				
+				fd = os.open(self.filename, os.O_RDWR | os.O_CREAT, perms)
 			except OSError:
 				return
 			try:
@@ -106,7 +106,9 @@ class SHVFile:
 		try:
 			self.f.seek(0)
 			self.f.truncate()
-			for name, value in self.variables.iteritems():
+			ordereditems = self.variables.items()
+			ordereditems.sort(lambda x, y: cmp(x[0], y[0]))
+			for name, value in ordereditems:
 				self.f.write(name + "=" + escape(value) + "\n")
 			self.f.flush()
 			os.fsync(self.f.fileno())