Ejemplo n.º 1
0
def make_temp_path(prefix) -> str:
    from nspawn import CONFIG
    from nspawn.tool.stamp import build_stamp
    tempdir = CONFIG['storage']['tempdir']
    temptime = build_stamp()
    temppath = f"{prefix}-{temptime}"
    return os.path.join(tempdir, temppath)
Ejemplo n.º 2
0
from nspawn.template.loader import *

from nspawn.base.machine import MachineMeta, machine_result_from_url
from nspawn.base.machine import MachineStore
from nspawn.base.machine import MachineResult
from nspawn import CONFIG
import platform
from nspawn.tool import stamp

build_stamp = stamp.build_stamp()

epoch = "3.9"
release = f"{epoch}.4"
hardware = platform.machine()
image_url = f"file://localhost/tmp/nspawn/repo/alpine/base/default-{release}-{hardware}.tar.gz"
booter_url = f"http://dl-cdn.alpinelinux.org/alpine/v{epoch}/releases/{hardware}/alpine-minirootfs-{release}-{hardware}.tar.gz"


def test_this_template():
    print()
    file_name = CONFIG['machine']['template']
    machine_template = f"{file_name}"
    template = this_template(machine_template)
    print(template)


def test_file_template():
    print()
    file_name = CONFIG['machine']['template']
    machine_template = f"{this_dir()}/{file_name}"