[virt-tools-list] [virt-manager PATCH 2/2] virt-install: fix condition that detect if console is present

Pavel Hrdina phrdina at redhat.com
Wed Nov 11 21:06:40 UTC 2015


On Wed, Nov 11, 2015 at 04:03:17PM -0500, Cole Robinson wrote:
> On 11/11/2015 04:01 PM, Pavel Hrdina wrote:
> > On Wed, Nov 11, 2015 at 03:50:30PM -0500, Cole Robinson wrote:
> >> On 11/11/2015 03:32 PM, Pavel Hrdina wrote:
> >>> Function get_devices() always returns a list, if there is no requested
> >>> device the list is empty.
> >>>
> >>> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> >>> ---
> >>>
> >>> Pushed as trivial.
> >>>
> >>>  virt-install | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/virt-install b/virt-install
> >>> index e465c46..c5c6e57 100755
> >>> --- a/virt-install
> >>> +++ b/virt-install
> >>> @@ -502,7 +502,7 @@ def _show_nographics_warnings(options, guest):
> >>>      # Trying --location --nographics with console connect. Warn if
> >>>      # they likely won't see any output.
> >>>  
> >>> -    if not guest.get_devices("console"):
> >>> +    if len(guest.get_devices("console")) = 0:
> >>>          logging.warn(_("No --console device added, you likely will not "
> >>>              "see text install output from the guest."))
> >>>          return
> >>>
> >>
> >> Does this actually make a difference? 'not []' returns True after all...
> >>
> >> - Cole
> > 
> > Hm, that's true, I wonder, why I didn't saw that warning before.  I've pushed it
> > already, so should we leave it as it is or revert this patch?
> > 
> 
> It's minor but I'd suggest reverting it, so that the git history indicates
> it's not a bug fix. I don't want to be scratching my head 6 months from now
> wondering if this actually fixed something, because I'll probably forget this
> conversation :)
> 
> - Cole
> 

Yes, that makes sense :)

Pavel




More information about the virt-tools-list mailing list