always load answers from a fixed path if it is present

This commit is contained in:
Michael Hudson-Doyle 2017-11-17 09:58:33 +13:00
parent 6919e5ce68
commit 7b375d9d92
1 changed files with 8 additions and 1 deletions

View File

@ -15,9 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import argparse
import sys
import logging
import os
import signal
import sys
from subiquitycore.i18n import *
from subiquitycore.log import setup_logger
@ -70,6 +71,8 @@ def parse_options(argv):
LOGDIR = "/var/log/installer/"
AUTO_ANSWERS_FILE = "/subiquity_config/answers.yaml"
def main():
opts = parse_options(sys.argv[1:])
global LOGDIR
@ -89,6 +92,10 @@ def main():
'Check {} for errors.'.format(LOGFILE))
return 1
if opts.answers is None and os.path.exists(AUTO_ANSWERS_FILE):
logger.debug("Autoloading answers from %s", AUTO_ANSWERS_FILE)
opts.answers = AUTO_ANSWERS_FILE
ui = SubiquityUI()
try: