help="Don't shrink any partition before extracting the image",
action="store_false")
+ parser.add_option("--no-cleanup", dest="cleanup", default=True,
+ help="Don't cleanup sensitive data before extracting the image",
+ action="store_false")
+
+ parser.add_option("-u", "--upload", dest="upload", default=False,
+ help="Upload image to a pithos repository using kamaki",
+ action="store_true")
+
+ parser.add_option("-r", "--register", dest="register", default=False,
+ help="Register image to okeanos using kamaki", action="store_true")
+
options, args = parser.parse_args(input_args)
if len(args) != 2:
if not os.path.exists(options.source):
parser.error('Input media is not accessible')
+ if options.register:
+ options.upload = True
+
return options
% os.path.basename(sys.argv[0]))
if not options.force:
- for ext in ('diskdump', 'meta'):
- filename = "%s/%s.%s" % (options.outdir, options.name, ext)
+ for extension in ('diskdump', 'meta'):
+ filename = "%s/%s.%s" % (options.outdir, options.name, extension)
if os.path.exists(filename):
raise FatalError("Output file %s exists "
"(use --force to overwrite it)." % filename)
osclass = get_os_class(dev.distro, dev.ostype)
image_os = osclass(dev.root, dev.g)
metadata = image_os.get_metadata()
- image_os.data_cleanup()
+
+ if options.cleanup:
+ image_os.data_cleanup()
+
dev.umount()
+
size = options.shrink and dev.shrink() or dev.size()
metadata['size'] = str(size // 2 ** 20)
finally:
disk.cleanup()
+ #The image is ready, lets call kamaki if necessary
+ if options.upload:
+ pass
+
return 0
COLOR_BLACK = "\033[00m"