Commit 7de017e5 authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Restore old personality syntax

Syntax is now the following:

kamaki create server 'Server name' <flavor id> <image id> [... params ...]
    --personality=local_path[,server_path[,owner[,group[,mode]]]]
parent f3446cf0
......@@ -929,7 +929,7 @@ It is often the case that a user who works in the context command, needs to crea
[server]:create 'my debian' 43 6aa6eafd-dccb-67fe2bdde87e
...
An other example (5.3.2) showcases how to aquire and modify configuration settings from a different context. In this case, user token changes while the user is working, so a token modification is needed.
An other example (5.3.2) showcases how to aquire and modify configuration settings from a different context. In this scenario, the user token expires at server side while the user is working. When that happens, the system responds with an *(401) UNAUTHORIZED* message. The user can aquires a new token (with a browser) which has to be set to kamaki.
.. code-block:: console
:emphasize-lines: 1
......@@ -955,14 +955,14 @@ An other example (5.3.2) showcases how to aquire and modify configuration settin
1. pithos (10MB, 2 objects)
2. trash (0B, 0 objects)
The following example presents some equivalent calls that call *astakos-authenticate* after a *store-list* 401 failure.
The following example compares some equivalent calls that run *astakos-authenticate* after a *store-list* 401 failure.
.. code-block:: console
:emphasize-lines: 1,3,10,17,28
Example 5.3.3: Equivalent astakos-authenticate calls after a store-list 401 failure
* one-command *
* without kamaki interactive shell *
$ kamaki store list
(401) UNAUTHORIZED Access denied
$ kamaki astakos authenticate
......@@ -983,9 +983,7 @@ The following example presents some equivalent calls that call *astakos-authenti
[kamaki]:astakos
[astakos]:authenticate
...
[astakos]:exit
[kamaki]:store
[store]:
[astakos]:
* minimum typing *
[store]: list
......
......@@ -147,10 +147,10 @@ class PersonalityArgument(ValueArgument):
def value(self, newvalue):
if newvalue == self.default:
return self.value
termlist = newvalue.split()
if len(termlist) > 4:
termlist = newvalue.split(',')
if len(termlist) > 5:
raise CLISyntaxError(details='Wrong number of terms'\
+ ' ("PATH [OWNER [GROUP [MODE]]]"')
+ ' ("PATH,[SERVER_PATH,[OWNER,[GROUP,[MODE]]]]"')
path = termlist[0]
self._value = dict(path=path)
if not exists(path):
......@@ -173,17 +173,15 @@ class server_create(_init_cyclades):
def __init__(self, arguments={}):
super(server_create, self).__init__(arguments)
self.arguments['personality'] = PersonalityArgument(\
help='add a personality file ( "PATH [OWNER [GROUP [MODE]]]" )',
'add a personality file ( ' +\
'"PATH,[SERVER_PATH,[OWNER,[GROUP,[MODE]]]]" )',
parsed_name='--personality')
def update_parser(self, parser):
parser.add_argument('--personality', dest='personalities',
action='append', default=[],
metavar='PATH[,SERVER PATH[,OWNER[,GROUP,[MODE]]]]',
help='add a personality file')
def main(self, name, flavor_id, image_id):
super(self.__class__, self).main()
print('PERSONLITY: ' % self.get_argument('personality'))
try:
reply = self.client.create_server(name,
int(flavor_id),
......
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