summaryrefslogtreecommitdiff
path: root/nova/virt/libvirt/event.py
diff options
context:
space:
mode:
authorEric Harney <eharney@redhat.com>2023-03-27 10:43:58 -0400
committerEric Harney <eharney@redhat.com>2023-03-27 10:43:58 -0400
commit29de62bf3b3bf5eda8986bc94babf1c94d67bd4e (patch)
tree9333f44c057b11ce69d4615ef8dca86f5c300e79 /nova/virt/libvirt/event.py
parent402b155043a51a71670476c1b693135f35d9b0cd (diff)
downloadnova-29de62bf3b3bf5eda8986bc94babf1c94d67bd4e.tar.gz
mypy: Fix implicit optional usage
Current versions of mypy run with no-implicit-optional by default. This change gets Nova's mypy test environment to pass again. Change-Id: Ie50c8d364ad9c339355cc138b560ec4df14fe307
Diffstat (limited to 'nova/virt/libvirt/event.py')
-rw-r--r--nova/virt/libvirt/event.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/nova/virt/libvirt/event.py b/nova/virt/libvirt/event.py
index a7d2a3624f..56951dc11c 100644
--- a/nova/virt/libvirt/event.py
+++ b/nova/virt/libvirt/event.py
@@ -9,6 +9,8 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
+import typing as ty
+
from nova.virt import event
@@ -22,7 +24,10 @@ class LibvirtEvent(event.InstanceEvent):
class DeviceEvent(LibvirtEvent):
"""Base class for device related libvirt events"""
- def __init__(self, uuid: str, dev: str, timestamp: float = None):
+ def __init__(self,
+ uuid: str,
+ dev: str,
+ timestamp: ty.Optional[float] = None):
super().__init__(uuid, timestamp)
self.dev = dev