Esempio n. 1
0
def remote_diff_slurp(nodes, filename):
    try:
        import parallax
    except ImportError:
        raise ValueError("Parallax is required to diff")
    from . import tmpfiles

    tmpdir = tmpfiles.create_dir()
    opts = parallax.Options()
    opts.localdir = tmpdir
    dst = os.path.basename(filename)
    return parallax.slurp(nodes, filename, dst, opts).items()
Esempio n. 2
0
def remote_diff_slurp(nodes, filename):
    try:
        import parallax
    except ImportError:
        raise ValueError("Parallax is required to diff")
    from . import tmpfiles

    tmpdir = tmpfiles.create_dir()
    opts = parallax.Options()
    opts.localdir = tmpdir
    dst = os.path.basename(filename)
    return parallax.slurp(nodes, filename, dst, opts).items()
Esempio n. 3
0
    def testCopyFile(self):
        opts = para.Options()
        opts.default_user = g_user
        opts.localdir = self.tmpDir
        by_host = para.copy(g_hosts, "/etc/hosts", "/tmp/para.test", opts)
        for host, result in by_host.items():
            if isinstance(result, para.Error):
                raise result
            rc, _, _ = result
            self.assertEqual(rc, 0)

        by_host = para.slurp(g_hosts, "/tmp/para.test", "para.test", opts)
        for host, result in by_host.items():
            if isinstance(result, para.Error):
                raise result
            rc, _, _, path = result
            self.assertEqual(rc, 0)
            self.assert_(path.endswith('%s/para.test' % (host)))
Esempio n. 4
0
 def slurp(self):
     dst = os.path.basename(self.filename)
     results = parallax.slurp(self.nodes, self.filename, dst, self.opts)
     return self.handle(list(results.items()))
Esempio n. 5
0
def _diff_slurp(pssh, nodes, filename):
    tmpdir = tmpfiles.create_dir()
    opts = pssh.Options()
    opts.localdir = tmpdir
    dst = os.path.basename(filename)
    return pssh.slurp(nodes, filename, dst, opts).items()