Skip to content
Snippets Groups Projects
Commit 4f4bd0c6 authored by corey lang's avatar corey lang Committed by Philip Müller
Browse files

[networkcfg] fix replace_username() undefined variables

parent 03fa5ad2
Branches
Tags
No related merge requests found
......@@ -73,12 +73,12 @@ def replace_username(nm_config_filename, live_user, target_user):
if not os.path.exists(nm_config_filename):
return
with open(target_network, "r") as network_conf:
with open(nm_config_filename, "r") as network_conf:
text = network_conf.readlines()
live_permissions = 'permissions=user:{}:;'.format(live_user)
target_permissions = 'permissions=user:{}:;\n'.format(user)
with open(target_network, "w") as network_conf:
target_permissions = 'permissions=user:{}:;\n'.format(target_user)
with open(nm_config_filename, "w") as network_conf:
for line in text:
if live_permissions in line:
line = target_permissions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment