Add uuid to update payload (#2070)

* Add uuid to update payload

* Add it to test
This commit is contained in:
Joakim Sørensen 2020-09-22 23:38:04 +02:00 committed by GitHub
parent 9443032c2a
commit 9274a0fa17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -59,6 +59,11 @@ class NetworkInterface:
"""Return the interface id."""
return self.connection.id
@property
def uuid(self) -> str:
"""Return the interface uuid."""
return self.connection.uuid
@property
def method(self) -> InterfaceMethod:
"""Return the interface method."""

View File

@ -2,7 +2,8 @@
'connection':
{
'id': <'{{interface.id}}'>,
'type': <'{{interface.type}}'>
'type': <'{{interface.type}}'>,
'uuid': <'{{interface.uuid}}'>
},
{% if options.get("method") == "auto" %}

View File

@ -18,6 +18,10 @@ async def test_interface_update_payload_ethernet(network_interface):
assert DBus.parse_gvariant(data)["ipv4"]["method"] == "manual"
assert DBus.parse_gvariant(data)["ipv4"]["address-data"][0]["address"] == "1.1.1.1"
assert DBus.parse_gvariant(data)["ipv4"]["dns"] == [16843009, 16777217]
assert (
DBus.parse_gvariant(data)["connection"]["uuid"]
== "0c23631e-2118-355c-bbb0-8943229cb0d6"
)
@pytest.mark.asyncio