From c9f5e30976bd6951fae1ff67e6ff618d690df5f6 Mon Sep 17 00:00:00 2001 From: Thomas S Hatch Date: Fri, 19 Apr 2013 17:15:32 -0600 Subject: [PATCH] Add dropfile function to utils --- salt/utils/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/salt/utils/__init__.py b/salt/utils/__init__.py index 2fe77048c9..34c802fee3 100644 --- a/salt/utils/__init__.py +++ b/salt/utils/__init__.py @@ -965,6 +965,18 @@ def valid_url(url, protos): return False +def dropfile(): + ''' + Set an aes dropfile to update the publish session key + ''' + dfn = os.path.join(self.opts['cachedir'], '.dfn') + aes = salt.crypt.Crypticle.generate_key_string() + mask = os.umask(191) + with open(dfn, 'w+') as fp_: + fp_.write(aes) + os.umask(mask) + + def parse_docstring(docstring): ''' Parse a docstring into its parts.