Commit 03d661d8 authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Replace pithos_cli.MetaArguement with KeyValueArg

parent c93d5123
......@@ -8,8 +8,7 @@ Kamaki project documentation
.. image:: /images/kamaki-logo.png
./kamaki is a simple, yet intuitive, command-line tool for managing clouds. Run
it without arguments to see a list of available commands.
./kamaki is a simple, yet intuitive, multipurpose command-line tool and client API for managing clouds.
It is an initial implementation of the OpenStack Compute API, v1.1, with custom
extensions specific to the Synnefo IaaS cloud management software.
......
......@@ -36,7 +36,6 @@ With virtualenv users can setup kamaki and synnefo services in a sandbox environ
.. code-block:: console
$ virtualenv kamaki-env
$ source kamaki-env/bin/activate
A more detailed example of using virtual env can be found at the `snf-image-creator setup guide <http://docs.dev.grnet.gr/snf-image-creator/latest/install.html#python-virtual-environment>`_
......@@ -49,11 +48,8 @@ Package snf-common is part of the synnefo project and is a kamaki dependency sin
.. code-block:: console
$ git clone http://code.grnet.gr/git/synnefo
$ cd synnefo/snf-common
$ ./setup build install
$ cd -
3. Install kamaki
......@@ -62,9 +58,7 @@ Package snf-common is part of the synnefo project and is a kamaki dependency sin
.. code-block:: console
$ git clone http://code.grnet.gr/git/kamaki
$ cd kamaki
$ ./setup build install
4. Install progress and/or ansicolors (optional)
......@@ -77,7 +71,6 @@ ansicolors: color kamaki output (can switched on and off in `setup <setup.html>`
.. code-block:: console
$ pip install progress
$ pip install ansicolors
Ubuntu and Debian packages
......@@ -122,7 +115,6 @@ Since version 0.6.0, the package snf-common (available at synnefo apt repository
.. code-block:: console
$ sudo apt-get install python-ansicolors
$ sudo apt-get install python-progress
Mac OS X
......
......@@ -27,9 +27,8 @@ The *kamaki* development team values your help and depends on community feedback
Community & Support
-------------------
For any problems you may bump into while using *kamaki* or for help from the development team please contact us at:
For any problems you may bump into while using *kamaki* or for help from the development team please contact us at::
* synnefo@lists.grnet.gr
synnefo@lists.grnet.gr
Please be sure to have read the Documentation and check the known issues before contacting the team.
......@@ -32,7 +32,9 @@ Kamaki setups are stored in configuration files. By default, a Kamaki installati
If a user needs to switch between different setups, Kamaki can explicitly load configuration files with the --config option:
*kamaki --config <custom_config_file_path> [other options]*
.. code-block:: console
$ kamaki --config <custom_config_file_path> [other options]
Using many different configuration files for different cloud services is encouraged.
......@@ -41,7 +43,9 @@ Modifying options at runtime
All kamaki commands can be used with the -o option in order to override configuration options at runtime. For example::
kamaki store list -o global.account=anotheraccount -o global.token=aT0k3n==
.. code-block:: console
$ kamaki store list -o global.account=anotheraccount -o global.token=aT0k3n==
will invoke *kamaki store list* with the specified options, but the initial global.account and global.token values will be restored to initial values afterwards.
......@@ -69,9 +73,11 @@ Editing the configuration file
The configuration file is a simple text file that can be created by the user.
A simple way to create the configuration file is to set a configuration option using the kamaki config command. For example::
A simple way to create the configuration file is to set a configuration option using the kamaki config command. For example:
.. code-block:: console
kamaki config set account myusername@mydomain.com
$ kamaki config set account myusername@mydomain.com
In the above example, if the kamaki configuration file does not exist, it will be created with all the default values plus the *global.account* option set to *myusername@mydomain.com* value.
......@@ -135,9 +141,9 @@ The [global] group is treated by kamaki as a generic group for arbitrary options
Hidden features
^^^^^^^^^^^^^^^
Since version 0.6.1 kamaki contains a test suite for the kamaki.clients API. The test suite can be activated with the following option on the configuration file:
Since version 0.6.1 kamaki contains a test suite for the kamaki.clients API. The test suite can be activated with the following option on the configuration file::
[test]
cli=test_cli
[test]
cli=test_cli
After that, users can run "kamaki test" commands to unit-test the prepackaged client APIs. Unit-tests are still experimental and there is a high probability of false alarms due to some of the expected values being hard-coded in the testing code.
......@@ -36,6 +36,7 @@ from kamaki.cli.command_tree import CommandTree
from kamaki.cli.errors import CLIError, raiseCLIError
from kamaki.cli.utils import format_size, print_dict, pretty_keys
from kamaki.cli.argument import FlagArgument, ValueArgument, IntArgument
from kamaki.cli.argument import KeyValueArgument
from kamaki.cli.argument import ProgressBarArgument
from kamaki.cli.commands import _command_init
from kamaki.clients.pithos import PithosClient, ClientError
......@@ -53,6 +54,9 @@ _commands = [pithos_cmds]
class DelimiterArgument(ValueArgument):
"""Set a custom delimiter, default is '/'
"""
def __init__(self, caller_obj, help='', parsed_name=None, default=None):
super(DelimiterArgument, self).__init__(help, parsed_name, default)
self.caller_obj = caller_obj
......@@ -67,8 +71,6 @@ class DelimiterArgument(ValueArgument):
def value(self, newvalue):
self._value = newvalue
class MetaArgument(ValueArgument):
@property
def value(self):
if self._value is None:
......@@ -398,7 +400,9 @@ class store_create(_store_container_command):
self.arguments['quota'] =\
IntArgument('set default container quota', '--quota')
self.arguments['meta'] =\
MetaArgument('set container metadata', '--meta')
KeyValueArgument(
'set container metadata (can be repeated)', '--meta')
# MetaArgument('set container metadata', '--meta')
def main(self, container____directory__):
super(self.__class__, self).main(container____directory__)
......
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