def check_prompt_img_outfilepath():
cfg.opts.outFile = '{}/{}'.format(cfg.opts.img_dir, cfg.opts.vmname)
if cfg.opts.img_format in 'qcow2':
cfg.opts.outFile += '.qcow2'
# Ensure image file doesn't exist
while os.path.exists(cfg.opts.outFile):
print(c.YELLOW("Already have an image file with the name '{}' (in dir '{}')".format(os.path.basename(cfg.opts.outFile), cfg.opts.img_dir)))
if not stdout.isatty():
exit(1)
_x = raw_input(c.CYAN("\nEnter a unique image file name (not incl. path) : "))
cfg.opts.outFile = '{}/{}'.format(cfg.opts.img_dir, _x)
评论列表
文章目录