Commit 5f722223 authored by Yingjie Xu's avatar Yingjie Xu

Simplify file writing.

parent 3313b309
...@@ -405,9 +405,7 @@ class Partition(object): ...@@ -405,9 +405,7 @@ class Partition(object):
parameter_dict = self.computer_partition.getInstanceParameterDict() parameter_dict = self.computer_partition.getInstanceParameterDict()
if 'timestamp' in parameter_dict: if 'timestamp' in parameter_dict:
timestamp_path = os.path.join(self.instance_path, '.timestamp') timestamp_path = os.path.join(self.instance_path, '.timestamp')
descriptor = open(timestamp_path, 'w') open(timestamp_path, 'w').write(parameter_dict['timestamp'])
descriptor.write(parameter_dict['timestamp'])
descriptor.close()
def start(self): def start(self):
"""Asks supervisord to start the instance. If this instance is not """Asks supervisord to start the instance. If this instance is not
......
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