diff --git a/scripts/runtests.sh b/scripts/runtests.sh index 8b83d213..2bbe97cc 100755 --- a/scripts/runtests.sh +++ b/scripts/runtests.sh @@ -20,7 +20,7 @@ for answers in examples/answers*.yaml; do done timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m subiquity.cmd.tui --autoinstall examples/autoinstall.yaml \ --dry-run --machine-config examples/simple.json \ - --kernel-cmdline 'autoinstall console=$(tty)'" + --kernel-cmdline 'autoinstall console=\"$(tty)\"'" python3 scripts/validate-yaml.py .subiquity/subiquity-curtin-install.conf \ debconf_selections.subiquity='"eek"' grep 'finish: subiquity/InstallProgress/postinstall/install_package1: SUCCESS: installing package1' \ diff --git a/subiquity/core.py b/subiquity/core.py index 051c2b5a..d38586bc 100644 --- a/subiquity/core.py +++ b/subiquity/core.py @@ -184,7 +184,10 @@ class Subiquity(Application): with open(self.opts.autoinstall) as fp: self.autoinstall_config = yaml.safe_load(fp) primary_tty = self.get_primary_tty() - our_tty = os.ttyname(0) + try: + our_tty = os.ttyname(0) + except OSError: + our_tty = "not a tty" if not self.interactive() and our_tty != primary_tty: print( _("the installer running on {} will perform the "