Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Blomdell
hostinfo
Commits
bedc366a
Commit
bedc366a
authored
Jan 09, 2018
by
Anders Blomdell
Browse files
Always set UUID
parent
984c0f33
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hostinfo/ifconfig.py
View file @
bedc366a
...
...
@@ -3,9 +3,11 @@ import subprocess
import
re
import
ipaddr
import
sys
import
uuid
def
get_nm_extra
(
device
):
result
=
""
uuid_is_set
=
False
try
:
import
dbus
bus
=
dbus
.
SystemBus
()
...
...
@@ -37,10 +39,13 @@ def get_nm_extra(device):
connection
=
settings
[
'connection'
]
if
'uuid'
in
connection
:
result
+=
'UUID=%s
\n
'
%
connection
[
'uuid'
]
uuid_is_set
=
True
if
'zone'
in
connection
:
result
+=
'ZONE=%s
\n
'
%
connection
[
'zone'
]
except
:
pass
if
not
uuid_is_set
:
result
+=
'UUID=%s
\n
'
%
uuid
.
uuid4
()
return
result
def
interface_is_static
(
i
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment