diff --git a/vmware-esxi/README.md b/vmware-esxi/README.md index 02f55c65..8a441944 100644 --- a/vmware-esxi/README.md +++ b/vmware-esxi/README.md @@ -68,6 +68,9 @@ maas $PROFILE boot-resources create \ architecture='amd64/generic' filetype='ddgz' \ content@=vmware-esxi.dd.gz ``` +## Default Credentials + +The default username is ```root``` and the default password is set to ```password123!``` ## Known limitations diff --git a/vmware-esxi/curtin/curtin-hooks b/vmware-esxi/curtin/curtin-hooks index 8c22caff..d5d0b8d7 100755 --- a/vmware-esxi/curtin/curtin-hooks +++ b/vmware-esxi/curtin/curtin-hooks @@ -30,12 +30,19 @@ from curtin.log import LOG from curtin.util import load_command_environment -def exec_prog(*cmdline: str) -> None: - subprocess.check_call( - cmdline, - stdout=subprocess.DEVNULL, - stderr=subprocess.STDOUT, - ) +def exec_prog(command): + try: + result = subprocess.run(command, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + text=True, shell=True) + + if result.returncode == 0: + LOG.info(result.stdout) + else: + print("Error:\n", result.stderr) + except Exception as e: + print(f"Exception: {e}") def write_config(target, config): @@ -67,11 +74,11 @@ def write_config(target, config): LOG.info("altbootbank found at %s", altbootbank_blkdev) altbootbank_mount_point = tempfile.mkdtemp(prefix="curtin-hooks-") - exec_prog("mount", altbootbank_blkdev, altbootbank_mount_point) + exec_prog(f"mount {altbootbank_blkdev} {altbootbank_mount_point}") scripts_pkg = os.path.join(os.path.dirname(__file__), "scripts.tar.xz") LOG.info("MAAS scripts found at %s", scripts_pkg) - exec_prog("tar", "xJf", scripts_pkg, "-C", altbootbank_mount_point) + exec_prog(f"tar xJf {scripts_pkg} -C {altbootbank_mount_point}") os.remove(scripts_pkg) curtin_cfg_path = os.path.join( @@ -82,7 +89,7 @@ def write_config(target, config): LOG.info("wrote Curtin config to %s", curtin_cfg_path) - exec_prog("umount", altbootbank_mount_point) + exec_prog(f"umount {altbootbank_mount_point}") def cleanup(): diff --git a/vmware-esxi/requirements.txt b/vmware-esxi/requirements.txt index 6ee70221..ae4d2deb 100644 --- a/vmware-esxi/requirements.txt +++ b/vmware-esxi/requirements.txt @@ -1,4 +1,4 @@ ipaddr==2.2.0 -oauthlib==3.1.0 -PyYAML==5.4.1 +oauthlib==3.2.2 +PyYAML==6.0.1 requests==2.31.0