From 043f4bf9acd3545d2a57f4ccf20855c38b0dfb11 Mon Sep 17 00:00:00 2001 From: Sergio Schvezov Date: Tue, 16 Apr 2019 13:32:27 -0300 Subject: [PATCH] build providers: get rid of attribute warnings from pylxd Filter out this specific warning, and potentially others coming from pylxd.models.operation which are irrelevant to the end user: /snap/snapcraft/2839/lib/python3.5/site-packages/pylxd/models/operation.py:59: UserWarning: Attempted to set unknown attribute "location" on instance of "Operation" .format(key, self.__class__.__name__)) Signed-off-by: Sergio Schvezov --- snapcraft/internal/build_providers/_lxd/_lxd.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/snapcraft/internal/build_providers/_lxd/_lxd.py b/snapcraft/internal/build_providers/_lxd/_lxd.py index 66f2b80365..e7385be414 100644 --- a/snapcraft/internal/build_providers/_lxd/_lxd.py +++ b/snapcraft/internal/build_providers/_lxd/_lxd.py @@ -19,6 +19,7 @@ import subprocess import sys import urllib.parse +import warnings from typing import Optional, Sequence import pylxd @@ -31,6 +32,9 @@ logger = logging.getLogger(__name__) +# Filter out attribute setting warnings for properties that exist in LXD operations +# but are unhandled in pylxd. +warnings.filterwarnings("ignore", module="pylxd.models.operation") class LXD(Provider):