Exemplo n.º 1
0
    def no_test_issue_10408_ext_pillar_gitfs_url_update(self):
        import os
        from salt.pillar import git_pillar
        original_url = 'git+ssh://[email protected]/home/git/test'
        changed_url = 'git+ssh://[email protected]/home/git/test'
        rp_location = os.path.join(self.master_opts['cachedir'], 'pillar_gitfs/0/.git')
        opts = {
            'ext_pillar': [{'git': 'master {0}'.format(original_url)}],
            'cachedir': self.master_opts['cachedir'],
        }

        git_pillar._LegacyGitPillar('master', original_url, opts)
        opts['ext_pillar'] = [{'git': 'master {0}'.format(changed_url)}]
        grepo = git_pillar._LegacyGitPillar('master', changed_url, opts)
        repo = git.Repo(rp_location)

        self.assertEqual(grepo.rp_location, repo.remotes.origin.url)
Exemplo n.º 2
0
    def no_test_issue_10408_ext_pillar_gitfs_url_update(self):
        import os
        from salt.pillar import git_pillar
        original_url = 'git+ssh://[email protected]/home/git/test'
        changed_url = 'git+ssh://[email protected]/home/git/test'
        rp_location = os.path.join(self.master_opts['cachedir'], 'pillar_gitfs/0/.git')
        opts = {
            'ext_pillar': [{'git': 'master {0}'.format(original_url)}],
            'cachedir': self.master_opts['cachedir'],
        }

        git_pillar._LegacyGitPillar('master', original_url, opts)
        opts['ext_pillar'] = [{'git': 'master {0}'.format(changed_url)}]
        grepo = git_pillar._LegacyGitPillar('master', changed_url, opts)
        repo = git.Repo(rp_location)

        self.assertEqual(grepo.rp_location, repo.remotes.origin.url)
Exemplo n.º 3
0
    def test_ext_pillar_env_mapping(self):
        import os
        from salt.pillar import git_pillar
        import git

        repo_url = 'https://github.com/saltstack/pillar1.git'
        pillar = self.run_function('pillar.data')

        for branch, env in [('dev', 'testing')]:
            repo = git_pillar._LegacyGitPillar(branch, repo_url, self.master_opts)

            self.assertIn(repo.working_dir,
                    pillar['test_ext_pillar_opts']['pillar_roots'][env])