[networkcfg] fix replace_username() undefined variables
This commit is contained in:
parent
03fa5ad209
commit
4f4bd0c6b1
@ -73,12 +73,12 @@ def replace_username(nm_config_filename, live_user, target_user):
|
|||||||
if not os.path.exists(nm_config_filename):
|
if not os.path.exists(nm_config_filename):
|
||||||
return
|
return
|
||||||
|
|
||||||
with open(target_network, "r") as network_conf:
|
with open(nm_config_filename, "r") as network_conf:
|
||||||
text = network_conf.readlines()
|
text = network_conf.readlines()
|
||||||
|
|
||||||
live_permissions = 'permissions=user:{}:;'.format(live_user)
|
live_permissions = 'permissions=user:{}:;'.format(live_user)
|
||||||
target_permissions = 'permissions=user:{}:;\n'.format(user)
|
target_permissions = 'permissions=user:{}:;\n'.format(target_user)
|
||||||
with open(target_network, "w") as network_conf:
|
with open(nm_config_filename, "w") as network_conf:
|
||||||
for line in text:
|
for line in text:
|
||||||
if live_permissions in line:
|
if live_permissions in line:
|
||||||
line = target_permissions
|
line = target_permissions
|
||||||
|
Loading…
Reference in New Issue
Block a user