Writes the given ruleset to the
        server configuration file.
        :type rules: collections.Iterable[Rule]

def _write_to_server(self, rules: list):
        """
        Writes the given ruleset to the
        server configuration file.
        :type rules: collections.Iterable[Rule]
        """
        self._create_directory_structure()
        config_data = '\n'.join(rule.config_string for rule in rules)
        sftp = self.client.open_sftp()
        try:
            with sftp.open(self.rule_location, 'w') as file_handle:
                file_handle.write(config_data)
                file_handle.write('\n')
        finally:
            sftp.close()