Bug 1286996 - When running from virt-builder --install it breaks with AttributeError
When running from virt-builder --install it breaks with AttributeError
Status: CLOSED DUPLICATE of bug 1280029
Product: Fedora
Classification: Fedora
Component: libguestfs (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Richard W.M. Jones
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-12-01 05:12 EST by David Caro
Modified: 2016-06-26 19:50 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-12-01 07:17:01 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description David Caro 2015-12-01 05:12:01 EST
Description of problem:
When you run virt-builder to create a new image, and pass the option --install with some packages, dnf breaks with the error:

Traceback (most recent call last):
  File "/bin/dnf", line 35, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 198, in user_main
    errcode = main(args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 144, in _main
    ret = resolving(cli, base)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 173, in resolving
  File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 220, in do_transaction
  File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 251, in gpgsigcheck
    if not sys.stdin.isatty() and not ay:
AttributeError: 'NoneType' object has no attribute 'isatty'

Probably trying to see if it should ask for confirmation on the gpg signature or something.

Version-Release number of selected component (if applicable):
$ rpm -qa dnf

How reproducible:
Just try to run virt-builder with the --install option, for example:
$ virt-builder -o v1.qcow2 --cache $PWD --format qcow2 --arch x86_64 --install qemu-guest-agent --root-password password:12345 fedora-23

Steps to Reproduce:
1.Just try to run virt-builder with the --install option on fedora-23 os version

Actual results:
Fails to create the image with dnf error

Expected results:
Image created and packages installed

Additional info:
Comment 1 David Caro 2015-12-01 05:34:48 EST
Actually, this is not true, this bug has been addressed on dnf, but the version that the fedora-23 image has installed is not the latest and still has this bug, the commit that solves this is:

commit b7c55d013542ce9e4c7775737bf454d9b10df977
Author: Adam Williamson <awilliam@redhat.com>
Date:   Tue Nov 17 15:04:19 2015 -0800

    cli: don't crash if y/n and sys.stdin is None (RhBug:1278382)
    Per https://bugzilla.redhat.com/show_bug.cgi?id=1278382 , if
    sys.stdin is somehow None (which currently seems to be the case
    when a dnf command is run in virt-builder) and a dnf command
    leads to a y/n question, dnf will crash. This should fix it.

Passing to libguestfs so they update the image
Comment 2 Richard W.M. Jones 2015-12-01 07:17:01 EST

*** This bug has been marked as a duplicate of bug 1280029 ***

Note You need to log in before you can comment on or make changes to this bug.