796f168c5c
Add additional tox job 'buildimage-lxd' which produces lxd metadata package and rootfs with installs nfs-ganesha, unfs3 and cifs. Co-Authored-By: Alexey Ovchinnikov <aovchinnikov@mirantis.com> Change-Id: Ia5a4701a828aeef93840f9c0a0e1d0bc0f4a5a2e
21 lines
523 B
Python
Executable File
21 lines
523 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
from __future__ import print_function
|
|
import tarfile
|
|
import sys
|
|
|
|
|
|
def main(tar_path, folder_path, target_name):
|
|
try:
|
|
tar = tarfile.open(tar_path, mode="a")
|
|
tar.add(folder_path, arcname=target_name)
|
|
tar.close()
|
|
except Exception as e:
|
|
print("Error: ", e)
|
|
|
|
if __name__ == "__main__":
|
|
if len(sys.argv) != 4:
|
|
print("Usage: "
|
|
"add_to_rootfs_tar <path_to_tar> <path_to_folder> <target_name>")
|
|
|
|
main(sys.argv[1], sys.argv[2], sys.argv[3]) |