diff options
-rw-r--r-- | sos/policies/__init__.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py index 8d74caaf..ae85991c 100644 --- a/sos/policies/__init__.py +++ b/sos/policies/__init__.py @@ -385,6 +385,9 @@ class PresetDefaults(object): odict = self.opts.dict() pdict = {self.name: {DESC: self.desc, NOTE: self.note, OPTS: odict}} + if not os.path.exists(presets_path): + os.makedirs(presets_path, mode=0o755) + with open(os.path.join(presets_path, self.name), "w") as pfile: json.dump(pdict, pfile) |