Commit 75fd709e by Karsa Zoltán István

disk path

parent 07471700
...@@ -194,18 +194,23 @@ class Disk(object): ...@@ -194,18 +194,23 @@ class Disk(object):
return False return False
def create_ci_disk(self, meta_data, user_data): def create_ci_disk(self, meta_data, user_data):
disk_path = self.get_path() tmp_dir = self.dir + '/dir' + self.name
logger.info("Create CI iso to %s", disk_path) os.mkdir(tmp_dir)
with open(self.dir + '/meta-data', 'w') as f: meta_path = tmp_dir + '/meta-data'
user_path = tmp_dir + '/user-data'
with open(meta_path, 'w') as f:
f.write(meta_data) f.write(meta_data)
with open(self.dir + '/user-data', 'w') as f: with open(user_path, 'w') as f:
f.write(user_data) f.write(user_data)
cmdline = ['genisoimage', cmdline = ['genisoimage',
'-output', self.get_path(), '-output', self.get_path(),
'-V', 'cidata', '-r', '-J', '-V', 'cidata', '-r', '-J',
self.dir + '/meta-data', meta_path,
self.dir + '/user-data'] user_path]
subprocess.check_output(cmdline) subprocess.check_output(cmdline)
os.remove(meta_path)
os.remove(user_path)
os.removedirs(tmp_dir)
self.size = Disk.get(self.dir, self.name).size self.size = Disk.get(self.dir, self.name).size
......
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 sign in to comment