"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/ansible/plugins/action/enos_config.py" between
ansible-2.7.6.tar.gz and ansible-2.7.7.tar.gz

About: Ansible is a platform for configuring and managing computers combining multi-node software deployment, ad hoc task execution, and configuration management.

enos_config.py  (ansible-2.7.6):enos_config.py  (ansible-2.7.7)
skipping to change at line 69 skipping to change at line 69
def _get_working_path(self): def _get_working_path(self):
cwd = self._loader.get_basedir() cwd = self._loader.get_basedir()
if self._task._role is not None: if self._task._role is not None:
cwd = self._task._role._role_path cwd = self._task._role._role_path
return cwd return cwd
def _write_backup(self, host, contents): def _write_backup(self, host, contents):
backup_path = self._get_working_path() + '/backup' backup_path = self._get_working_path() + '/backup'
if not os.path.exists(backup_path): if not os.path.exists(backup_path):
os.mkdir(backup_path) os.mkdir(backup_path)
for fn in glob.glob('%s/%s*' % (backup_path, host)): for fn in glob.glob('%s/%s_config.*' % (backup_path, host)):
os.remove(fn) os.remove(fn)
tstamp = time.strftime("%Y-%m-%d@%H:%M:%S", time.localtime(time.time())) tstamp = time.strftime("%Y-%m-%d@%H:%M:%S", time.localtime(time.time()))
filename = '%s/%s_config.%s' % (backup_path, host, tstamp) filename = '%s/%s_config.%s' % (backup_path, host, tstamp)
open(filename, 'w').write(contents) open(filename, 'w').write(contents)
return filename return filename
def _handle_template(self): def _handle_template(self):
src = self._task.args.get('src') src = self._task.args.get('src')
working_path = self._get_working_path() working_path = self._get_working_path()
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)