Commit 18b8307
Transfer ownership of files over ssh with sudo/su (#616)
* Transfer ownership of files over ssh with sudo/su.
Adds a step to SSH file uploads that assigns read permissions via
ACLs to the sudo/su user, and uses cp instead of mv to allow the
the intended user to take ownership.
* Use format to maintain python2 compatibility
* Modify StringCommand for consistent styling.
Co-authored-by: Nick Barrett <[email protected]>
* Modify StringCommand for consistent styling.
Co-authored-by: Nick Barrett <[email protected]>
* Only run setfacl command if a sudo/su user is specified
* Remove redundant chown command
The chown command is no longer required because we now cp the file as
the sudo/su user, so the file is created with the correct ownership.
* Remove temporary files after upload
* Modify test cases for new SSH upload commands
* Linting whitespaces.
* Expand SSH connector tests to cover copy & acl failures.
Co-authored-by: ben <[email protected]>
Co-authored-by: Nick Barrett <[email protected]>1 parent d8729e0 commit 18b8307
File tree
3 files changed
+76
-15
lines changed- pyinfra/api/connectors
- tests/test_connectors
3 files changed
+76
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
| 423 | + | |
427 | 424 | | |
428 | | - | |
429 | | - | |
430 | | - | |
| 425 | + | |
431 | 426 | | |
432 | | - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
433 | 443 | | |
434 | 444 | | |
435 | 445 | | |
| |||
443 | 453 | | |
444 | 454 | | |
445 | 455 | | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
446 | 471 | | |
447 | 472 | | |
448 | 473 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
| 510 | + | |
| 511 | + | |
514 | 512 | | |
515 | 513 | | |
516 | 514 | | |
| |||
519 | 517 | | |
520 | 518 | | |
521 | 519 | | |
522 | | - | |
| 520 | + | |
523 | 521 | | |
524 | 522 | | |
525 | 523 | | |
| |||
540 | 538 | | |
541 | 539 | | |
542 | 540 | | |
543 | | - | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
544 | 579 | | |
545 | | - | |
| 580 | + | |
546 | 581 | | |
547 | 582 | | |
548 | 583 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
0 commit comments