netjsonconfig/backends/base/backend.py
def _process_files(self, tar):
        """
        Adds files specified in self.config['files'] to tarfile instance.

        :param tar: tarfile instance
        :returns: None
        """
        # insert additional files
        for file_item in self.config.get('files', []):
            path = file_item['path']
            # remove leading slashes from path
            if path.startswith('/'):
                path = path[1:]
            self._add_file(tar=tar,
                           name=path,
                           contents=file_item['contents'],
                           mode=file_item.get('mode', DEFAULT_FILE_MODE))
def _process_files(self, tar):
        """
        Adds files specified in self.config['files'] to tarfile instance.

        :param tar: tarfile instance
        :returns: None
        """
        # insert additional files
        for file_item in self.config.get('files', []):
            path = file_item['path']
            # remove leading slashes from path
            if path.startswith('/'):
                path = path[1:]
            self._add_file(tar=tar,
                           name=path,
                           contents=file_item['contents'],
                           mode=file_item.get('mode', DEFAULT_FILE_MODE))
Adds files specified in self.config['files'] to tarfile instance.

        :param tar: tarfile instance
        :returns: None