Bug 1286996 - When running from virt-builder --install it breaks with AttributeError
Summary: When running from virt-builder --install it breaks with AttributeError
Keywords:
Status: CLOSED DUPLICATE of bug 1280029
Alias: None
Product: Fedora
Classification: Fedora
Component: libguestfs
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-01 10:12 UTC by David Caro
Modified: 2016-06-26 23:50 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-01 12:17:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description David Caro 2015-12-01 10:12:01 UTC
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
    base.do_transaction(display=displays)
  File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 220, in do_transaction
    self.gpgsigcheck(downloadpkgs)
  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
dnf-1.1.4-2.fc23.noarch

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
2.
3.

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 10:34:48 UTC
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>
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 12:17:01 UTC

*** 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.