mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 00:22:28 +02:00
Wrapped tarfile for py26
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
"""Let's Encrypt Apache configuration submission script"""
|
"""Let's Encrypt Apache configuration submission script"""
|
||||||
import argparse
|
import argparse
|
||||||
|
import contextlib
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@@ -286,7 +287,8 @@ def main():
|
|||||||
make_and_verify_selection(args.server_root, tempdir)
|
make_and_verify_selection(args.server_root, tempdir)
|
||||||
|
|
||||||
tarpath = os.path.join(tempdir, "config.tar.gz")
|
tarpath = os.path.join(tempdir, "config.tar.gz")
|
||||||
with tarfile.open(tarpath, mode="w:gz") as tar:
|
# contextlib.closing used for py26 support
|
||||||
|
with contextlib.closing(tarfile.open(tarpath, mode="w:gz")) as tar:
|
||||||
tar.add(tempdir, arcname=".")
|
tar.add(tempdir, arcname=".")
|
||||||
|
|
||||||
# Submit tarpath
|
# Submit tarpath
|
||||||
|
|||||||
Reference in New Issue
Block a user