Skip to content

Commit

Permalink
Removed unused lines (feature removed in 010ca98)
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Feb 15, 2016
1 parent 1f86a07 commit d6f2674
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions netjsonconfig/backends/openwrt/openwrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,11 @@ def _render_files(self):
if files:
output += '\n{0}\n\n'.format(self.FILE_SECTION_DELIMITER)
for f in files:
if isinstance(f['contents'], list):
contents = '\n'.join(f['contents'])
else:
contents = f['contents']
path = f['path']
mode = f.get('mode', DEFAULT_FILE_MODE)
# add file to output
file_output = '# path: {0}\n'\
'# mode: {1}\n\n'\
'{2}\n\n'.format(path, mode, contents)
'{2}\n\n'.format(f['path'], mode, f['contents'])
output += file_output
return output

Expand Down Expand Up @@ -215,17 +210,13 @@ def _process_files(self, tar):
"""
# insert additional files
for file_item in self.config.get('files', []):
contents = file_item['contents']
path = file_item['path']
# join lines if contents is a list
if isinstance(contents, list):
contents = '\n'.join(contents)
# remove leading slashes from path
if path.startswith('/'):
path = path[1:]
self._add_file(tar=tar,
name=path,
contents=contents,
contents=file_item['contents'],
mode=file_item.get('mode', DEFAULT_FILE_MODE))

def _add_file(self, tar, name, contents, mode=DEFAULT_FILE_MODE):
Expand Down

0 comments on commit d6f2674

Please sign in to comment.