copy dir to minion via tarball
ClosedPublic

Authored by lbrabec on Aug 10 2016, 11:25 AM.

Details

Summary

This diff introduces a method put_dir_ng() (wip name, not sure whether to
replace original put_dir() or not) that creates a tarball from contents of
given directory, copies the tarball to remote machine and extracts the files to
specified remote path.

Test Plan

manually run with --libvirt

Diff Detail

Repository
rLTRN libtaskotron
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
lbrabec retitled this revision from to copy dir to minion via tarball.Aug 10 2016, 11:25 AM
lbrabec updated this object.
lbrabec edited the test plan for this revision. (Show Details)
lbrabec added reviewers: jskladan, kparal.

Looks good to me as a proof of concept, and if you have tested it thoroughly, I actually think we can just rename it and push it (with some minor tweaks, see below).

libtaskotron/minion.py
83–85

Let's add tar as a dependency of libtaskotron-core instead?

libtaskotron/remote_exec.py
332

If this works well, I have no issues replacing the original put_dir method (we can always use git revert). If you think there are still some uses for a standard recursive copy, let's name this put_dir_tarred().

334

Using

``local_path``

and

``remote_path``

helps readability in docs.

362

It seems you don't delete this file afterwards.

363

What if task.tar is already there? What if task.tar is inside the tar? :-)
We own /var/tmp/taskotron, maybe we could use it for this?

365

Maybe with statement could be useful here.

369

Does this work for nested directories? Please try with:

dir
file
dir/file
dir/dir/file

(using these exact names)

testing/test_remote_exec.py
229

I might be slow today, but I think the assert and is None do nothing here, because the method raises the error, and therefore neither the assert not the comparison is executed at all.

lbrabec updated this revision to Diff 2469.Aug 11 2016, 11:10 AM
  • polishing

I played with it and the debug output seems to be way too verbose. I think we should make it shorter. Could you apply P4 patch to this, if you like it?

libtaskotron.spec
34

F23 contains 1.28-6.

libtaskotron/remote_exec.py
322–325

Those variables should get bash-escaped, IIUIC.

lbrabec updated this revision to Diff 2471.Aug 11 2016, 1:09 PM
  • moar polish
lbrabec updated this revision to Diff 2472.Aug 11 2016, 1:10 PM
  • version fix in specfile
kparal accepted this revision.EditedAug 11 2016, 1:12 PM

Looks good.

//Edit: very ack.

This revision is now accepted and ready to land.Aug 11 2016, 1:12 PM
Closed by commit rLTRN57d507d6d966: copy dir to minion via tarball (authored by Lukas Brabec <lbrabec@redhat.com>). · Explain WhyAug 11 2016, 1:42 PM
This revision was automatically updated to reflect the committed changes.