From: Nikos Skalkotos Date: Tue, 7 Jan 2014 09:18:32 +0000 (+0200) Subject: Switch names btw snf-image-creator & snf-mkimage X-Git-Tag: 0.6~1^2~5 X-Git-Url: https://code.grnet.gr/git/snf-image-creator/commitdiff_plain/ebe0f1e05e2bc31da6622b82d0bee78df480732f Switch names btw snf-image-creator & snf-mkimage Make snf-image-creator be the dialog-based program and snf-mkimage be the command line one. --- diff --git a/README b/README index a05706d..6d6dacb 100644 --- a/README +++ b/README @@ -5,5 +5,5 @@ snf-image-creator is a command line tool for creating OS images to be used with synnefo. It comes in 2 variants: - * snf-image-creator: A non-interactive command line program - * snf-mkimage: A user-friendly dialog-based program + * snf-image-creator: A user-friendly dialog-based program + * snf-mkimage: A non-interactive command line program diff --git a/docs/conf.py b/docs/conf.py index 5521dad..3f6dee2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -238,10 +238,10 @@ latex_documents = [ # (source start file, name, description, authors, manual section). man_pages = [ ('man/snf-image-creator', 'snf-image-creator', - 'Command line image creator for Synnefo', + 'Dialog-based image creator for Synnefo', 'Synnefo development team ', 1), ('man/snf-mkimage', 'snf-mkimage', - 'Dialog-based image creator for Synnefo', + 'Command line image creator for Synnefo', 'Synnefo development team ', 1) ] diff --git a/docs/man/snf-image-creator.rst b/docs/man/snf-image-creator.rst index 9d38859..a714d27 100644 --- a/docs/man/snf-image-creator.rst +++ b/docs/man/snf-image-creator.rst @@ -1,74 +1,27 @@ :orphan: snf-image-creator manual page -============================= +======================= Synopsis -------- -**snf-image-creator** [OPTION] +**snf-image-creator** [OPTION] [] Description ----------- Create image out of an . The may be a block device, a regular file that represents a hard disk or \`/' to bundle the host system -itself. +itself. If the argument is missing, the user will be asked during +the program initializaton to specify one. Options ------- --a URL, --authentication-url=URL - use this authentication URL when uploading/registering images - --c CLOUD, --cloud=CLOUD - use this saved cloud account to authenticate against a cloud when - uploading/registering images - ---disable-sysprep=SYSPREP - prevent SYSPREP operation from running on the input media - ---enable-sysprep=SYSPREP - run SYSPREP operation on the input media - --f, --force - overwrite output files if they exist - +--version + show program's version number and exit -h, --help show this help message and exit - --m KEY=VALUE, --metadata=KEY=VALUE - add custom KEY=VALUE metadata to the image - ---no-shrink - don't shrink any partition - ---no-sysprep - don't perform any system preparation operation - --o FILE, --outfile=FILE - dump image to FILE - ---public - register image with the storage service as public - ---print-sysprep - print the enabled and disabled system preparation operations for this - input media - --r IMAGENAME, --register=IMAGENAME - register the image with the compute service with name IMAGENAME - --s, --silent - output only errors - --t TOKEN, --token=TOKEN - use this token when uploading/registering images - +-l FILE, --logfile=FILE + log all messages to FILE --tmpdir=DIR create large temporary image files under DIR - --u FILENAME, --upload=FILENAME - save the image to the storage service with remote name FILENAME - ---version - show program's version number and exit - diff --git a/docs/man/snf-mkimage.rst b/docs/man/snf-mkimage.rst index 87bbf10..c21b89b 100644 --- a/docs/man/snf-mkimage.rst +++ b/docs/man/snf-mkimage.rst @@ -1,27 +1,74 @@ :orphan: snf-mkimage manual page -======================= +============================= Synopsis -------- -**snf-mkimage** [OPTION] [] +**snf-mkimage** [OPTION] Description ----------- Create image out of an . The may be a block device, a regular file that represents a hard disk or \`/' to bundle the host system -itself. If the argument is missing, the user will be asked during -the program initializaton to specify one. +itself. Options ------- ---version - show program's version number and exit +-a URL, --authentication-url=URL + use this authentication URL when uploading/registering images + +-c CLOUD, --cloud=CLOUD + use this saved cloud account to authenticate against a cloud when + uploading/registering images + +--disable-sysprep=SYSPREP + prevent SYSPREP operation from running on the input media + +--enable-sysprep=SYSPREP + run SYSPREP operation on the input media + +-f, --force + overwrite output files if they exist + -h, --help show this help message and exit --l FILE, --logfile=FILE - log all messages to FILE + +-m KEY=VALUE, --metadata=KEY=VALUE + add custom KEY=VALUE metadata to the image + +--no-shrink + don't shrink any partition + +--no-sysprep + don't perform any system preparation operation + +-o FILE, --outfile=FILE + dump image to FILE + +--public + register image with the storage service as public + +--print-syspreps + print the enabled and disabled system preparation operations for this + input media + +-r IMAGENAME, --register=IMAGENAME + register the image with the compute service with name IMAGENAME + +-s, --silent + output only errors + +-t TOKEN, --token=TOKEN + use this token when uploading/registering images + --tmpdir=DIR create large temporary image files under DIR + +-u FILENAME, --upload=FILENAME + save the image to the storage service with remote name FILENAME + +--version + show program's version number and exit + diff --git a/docs/usage.rst b/docs/usage.rst index fc99172..6e436a7 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -3,8 +3,8 @@ Usage snf-image-creator comes in 2 variants: - * snf-image-creator: A non-interactive command line program - * snf-mkimage: A user-friendly dialog-based program + * snf-mkimage: A non-interactive command line program + * snf-image-creator: A user-friendly dialog-based program Both expect the input media as first argument. The input media may be a local file, a block device or *"/"* if you want to create an image out of the running @@ -13,12 +13,12 @@ system (see `host bundling operation`_). Non-interactive version ======================= -snf-image-creator receives the following options: +snf-mkimage receives the following options: .. code-block:: console - $ snf-image-creator --help - Usage: snf-image-creator [options] + $ snf-mkimage --help + Usage: snf-mkimage [options] Options: --version show program's version number and exit @@ -70,7 +70,7 @@ registered as *private*. Only the user that registers the image can create VM's out of it. If you want the image to be visible by other user too, use the *--public* option. -By default, before extracting the image, snf-image-creator will perform a +By default, before extracting the image, snf-mkimage will perform a number of system preparation operations on the snapshot of the media and will shrink the last partition found. Both actions can be disabled by specifying *--no-sysprep* and *--no-shrink* respectively. @@ -81,15 +81,15 @@ input media. The user can enable or disable specific *syspreps*, using *-{enable,disable}-sysprep* options. The user may specify those options multiple times. -Running *snf-image-creator* with *--print-sysprep* on a raw file that hosts a +Running *snf-mkimage* with *--print-sysprep* on a raw file that hosts a debian system, we print the following output: .. _sysprep: .. code-block:: console - $ snf-image-creator --print-sysprep ubuntu.raw - snf-image-creator 0.3 + $ snf-mkimage --print-syspreps ubuntu.raw + snf-image-creator 0.6 ===================== Examining source media `ubuntu_hd.raw' ... looks like an image file Snapshotting media source ... done @@ -150,17 +150,17 @@ removed, you should use *--enable-sysprep* option like this: .. code-block:: console - $ snf-image-creator --enable-sysprep cleanup-mail --enable-sysprep remove-user-accounts ... + $ snf-mkimage --enable-sysprep cleanup-mail --enable-sysprep remove-user-accounts ... Dialog-based version ==================== -*snf-mkimage* receives the following options: +*snf-image-creator* receives the following options: .. code-block:: console - $ snf-mkimage --help - Usage: snf-mkimage [options] [] + $ snf-image-creator --help + Usage: snf-image-creator [options] [] Options: --version show program's version number and exit @@ -179,12 +179,12 @@ button to create an image out of the running system (see `Host bundling operation`_). After the input media is examined and the program is initialized, the user will -be given the choice to run *snf-mkimage* in *wizard* or *expert* mode. +be given the choice to run *snf-image-creator* in *wizard* or *expert* mode. Wizard mode ----------- -When *snf-mkimage* runs in *wizard* mode, the user is just asked to provide the +When *snf-image-creator* runs in *wizard* mode, the user is just asked to provide the following basic information: * Cloud: The cloud account to use to upload and register the resulting image @@ -278,13 +278,13 @@ You will be able to boot your installed OS and make any changes you want $ sudo kvm -m 1G -boot c -drive file=ubuntu.raw,format=raw,cache=none,if=virtio -After you're done, you may use *snf-mkimage* as root to create and upload the +After you're done, you may use *snf-image-creator* as root to create and upload the image: .. code-block:: console $ sudo -s - $ snf-mkimage ubuntu.raw + $ snf-image-creator ubuntu.raw In the first screen you will be asked to choose if you want to run the program in *Wizard* or *Expert* mode. Choose *Wizard*. diff --git a/image_creator/main.py b/image_creator/main.py index 26e1be5..ccf5125 100644 --- a/image_creator/main.py +++ b/image_creator/main.py @@ -402,6 +402,10 @@ def main(): sys.exit(ret) except FatalError as e: colored = sys.stderr.isatty() + warning = \ + "The name of the executable has changed. If you want to use the " \ + "user-friendly dialog-based program try `snf-image-creator'" + SimpleOutput(colored).warn(warning) SimpleOutput(colored).error(e) sys.exit(1) diff --git a/setup.py b/setup.py index 3c67366..3a6dd27 100755 --- a/setup.py +++ b/setup.py @@ -52,8 +52,8 @@ setup( install_requires=['sh', 'ansicolors', 'progress>=1.0.2'], entry_points={ 'console_scripts': [ - 'snf-image-creator = image_creator.main:main', - 'snf-mkimage = image_creator.dialog_main:main'] + 'snf-mkimage = image_creator.main:main', + 'snf-image-creator = image_creator.dialog_main:main'] } ) # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :