From c40f6198a8147f6061156680c2001d23fd3454c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Hru=C5=A1eck=C3=BD?= Date: Wed, 26 Aug 2020 23:50:03 +0200 Subject: [PATCH] Fix Python 3 compatibility In Python 3, dict.keys doesn't return a list, but a set-like object that represents a view of the dictionary's keys and doesn't support indexing. Formula therefor didn't worked with Python 3. --- grains/init.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grains/init.sls b/grains/init.sls index ebb3c1f..b0b40f7 100644 --- a/grains/init.sls +++ b/grains/init.sls @@ -40,7 +40,7 @@ class GrainMaker: def _parseGrainValues(self, grain): # Parses individual grains and their values passed from the pillar - grainKey = grain.keys()[0] + grainKey = next(iter(grain.keys())) if grain[grainKey]: for value in grain[grainKey]: self._addToGrains(grain, grainKey, value)