Commit c0d165c6 authored by Tomáš Peterka's avatar Tomáš Peterka

[format] Small code cleanup

parent 640ae837
...@@ -611,8 +611,8 @@ class Computer(object): ...@@ -611,8 +611,8 @@ class Computer(object):
Return: Return:
A Computer object. A Computer object.
""" """
with open(path_to_xml, "rb") as fi:
dumped_dict = xml_marshaller.xml_marshaller.loads(open(path_to_xml).read()) dumped_dict = xml_marshaller.xml_marshaller.load(fi)
# Reconstructing the computer object from the xml # Reconstructing the computer object from the xml
computer = Computer( computer = Computer(
...@@ -980,7 +980,8 @@ class User(object): ...@@ -980,7 +980,8 @@ class User(object):
user_parameter_list.append('-r') user_parameter_list.append('-r')
callAndRead(['useradd'] + user_parameter_list) callAndRead(['useradd'] + user_parameter_list)
else: else:
callAndRead(['usermod'] + user_parameter_list) # if the user is already created and used we should not fail
callAndRead(['usermod'] + user_parameter_list, raise_on_error=False)
# lock the password of user # lock the password of user
callAndRead(['passwd', '-l', self.name]) callAndRead(['passwd', '-l', self.name])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment