MCPcopy Create free account
hub / github.com/apache/cloudstack / __moveFile

Method __moveFile

systemvm/debian/opt/cloud/bin/merge.py:329–340  ·  view source on GitHub ↗
(self, origPath, path)

Source from the content-addressed store, hash-verified

327 self.configCache = path
328
329 def __moveFile(self, origPath, path):
330 if not os.path.exists(path):
331 os.makedirs(path)
332 originalName = os.path.basename(origPath)
333 if originalName.count(".") == 1:
334 originalName += "." + str(uuid.uuid4())
335 zipped_file_name = path + "/" + originalName + ".gz"
336 with open(origPath, 'rb') as f_in, gzip.open(zipped_file_name, 'wb') as f_out:
337 shutil.copyfileobj(f_in, f_out)
338 os.remove(origPath)
339
340 logging.debug("Processed file written to %s", zipped_file_name)

Callers 1

loadMethod · 0.95

Calls 5

countMethod · 0.80
debugMethod · 0.80
existsMethod · 0.65
removeMethod · 0.65
openMethod · 0.45

Tested by

no test coverage detected