Revision c626151a

b/kamaki/cli/commands/astakos.py
72 72
    """Authenticate a user
73 73
    Get user information (e.g. unique account name) from token
74 74
    Token should be set in settings:
75
    *  check if a token is set    /config get token
76
    *  permanently set a token    /config set token <token>
75
    *  check if a token is set    /config get remote.default.token
76
    *  permanently set a token    /config set remote.default.token <token>
77 77
    Token can also be provided as a parameter
78
    (In case of another named cloud remote, use its name instead of default)
78 79
    """
79 80

  
80 81
    @staticmethod
b/kamaki/cli/commands/config.py
44 44

  
45 45
about_options = '\nAbout options:\
46 46
    \n. syntax: [group.]option\
47
    \n. example: file.uuid\
47
    \n. example: global.log_file\
48 48
    \n. special case: <option> is equivalent to global.<option>\
49 49
    \n. configuration file syntax:\
50 50
    \n.   [group]\
51 51
    \n.   option=value\
52
    \n.   (more options can be set per group)'
52
    \n.   (more options can be set per group)\
53
    \n. special case: named cloud remotes.\
54
    \n. E.g. for a cloud "demo":\
55
    \n.   [remote "demo"]\
56
    \n.   url = <http://single/authentication/url/for/demo/site>\
57
    \n.   token = <auth_token_from_demo_site>\
58
    \n. which are referenced as remote.demo.url , remote.demo.token'
53 59

  
54 60

  
55 61
@command(config_cmds)
b/kamaki/cli/commands/cyclades.py
53 53

  
54 54
about_authentication = '\nUser Authentication:\
55 55
    \n* to check authentication: /user authenticate\
56
    \n* to set authentication token: /config set token <token>'
56
    \n* to set authentication token: /config set remote.default.token <token>'
57 57

  
58 58
howto_personality = [
59 59
    'Defines a file to be injected to VMs personality.',
b/kamaki/cli/commands/errors.py
38 38
from kamaki.cli import _debug, kloger
39 39
from kamaki.cli.utils import format_size
40 40

  
41
CLOUDNAME = [
42
    'Note: If you use a named cloud remote, use its name',
43
    'instead of "default"']
44

  
41 45

  
42 46
class generic(object):
43 47

  
......
66 70
                    raiseCLIError(ce, 'Authorization failed', details=[
67 71
                        'Make sure a valid token is provided:',
68 72
                        '  to check if token is valid: /user authenticate',
69
                        '  to set token: /config set [.server.]token <token>',
70
                        '  to get current token: /config get [server.]token'])
73
                        '  to set token:',
74
                        '    /config set remote.default.token <token>',
75
                        '  to get current token:',
76
                        '    /config get remote.default.token'] + CLOUDNAME)
71 77
                elif ce.status in range(-12, 200) + [302, 401, 403, 500]:
72 78
                    raiseCLIError(ce, importance=3, details=[
73 79
                        'Check if service is up'])
......
79 85
                    msg = 'Invalid service url %s' % url
80 86
                    raiseCLIError(ce, msg, details=[
81 87
                        'Check if authentication url is correct',
82
                        '  check current url:   /config get url',
83
                        '  set new auth. url:   /config set url'])
88
                        '  check current url:',
89
                        '    /config get remote.default.url',
90
                        '  set new auth. url:',
91
                        '    /config set remote.default.url'] + CLOUDNAME)
84 92
                raise
85 93
        return _raise
86 94

  
......
88 96
class user(object):
89 97

  
90 98
    _token_details = [
91
        'To check default token: /config get token',
99
        'To check default token: /config get remote.default.token',
92 100
        'If set/update a token:',
93
        '*  (permanent):  /config set token <token>',
94
        '*  (temporary):  re-run with <token> parameter']
101
        '*  (permanent):  /config set remote.default.token <token>',
102
        '*  (temporary):  re-run with <token> parameter'] + CLOUDNAME
95 103

  
96 104
    @classmethod
97 105
    def load(this, foo):
......
103 111
                raiseCLIError(ae, 'Client setup failure', importance=3)
104 112
            if not getattr(client, 'token', False):
105 113
                kloger.warning(
106
                    'No permanent token (try: kamaki config set token <tkn>)')
114
                    'No permanent token (try:'
115
                    ' kamaki config set remote.default.token <tkn>)')
107 116
            if not getattr(client, 'base_url', False):
108
                msg = 'Missing synnefo URL'
117
                msg = 'Missing synnefo authentication URL'
109 118
                raise CLIError(msg, importance=3, details=[
110 119
                    'Check if authentication url is correct',
111
                        '  check current url:  /config get url',
112
                        '  set new auth. url:  /config set url'])
120
                        '  check current url:',
121
                        '    /config get remote.default.url',
122
                        '  set new auth. url:',
123
                        '    /config set remote.default.url'] + CLOUDNAME)
113 124
            return r
114 125
        return _raise
115 126

  
......
401 412
class pithos(object):
402 413
    container_howto = [
403 414
        'To specify a container:',
404
        '  1. Set file.container variable (permanent)',
405
        '     /config set file.container <container>',
406
        '  2. --container=<container> (temporary, overrides 1)',
407
        '  3. Use the container:path format (temporary, overrides all)',
415
        '  1. --container=<container> (temporary, overrides all)',
416
        '  2. Use the container:path format (temporary, overrides 3)',
417
        '  3. Set pithos_container variable (permanent)',
418
        '     /config set pithos_container <container>',
408 419
        'For a list of containers: /file list']
409 420

  
410 421
    @classmethod
......
435 446
                    raiseCLIError(ce, 'User quota exceeded', details=[
436 447
                        '* get quotas:',
437 448
                        '  * upper total limit:      /file quota',
438
                        '  * container limit:  /file quota <container>',
439
                        '* set a higher quota (if permitted):',
440
                        '    /file setquota <quota>[unit] <container>'
441
                        '    as long as <container quota> <= <total quota>'])
449
                        '  * container limit:',
450
                        '    /file containerlimit get <container>',
451
                        '* set a higher container limit:',
452
                        '    /file containerlimit set <limit> <container>'])
442 453
                raise
443 454
        return _raise
444 455

  
b/kamaki/cli/commands/image.py
59 59

  
60 60
howto_image_file = [
61 61
    'Kamaki commands to:',
62
    ' get current user uuid: /user authenticate',
62
    ' get current user id: /user authenticate',
63 63
    ' check available containers: /file list',
64 64
    ' create a new container: /file create <container>',
65 65
    ' check container contents: /file list <container>',
......
153 153

  
154 154
def _validate_image_location(location):
155 155
    """
156
    :param location: (str) pithos://<uuid>/<container>/<img-file-path>
156
    :param location: (str) pithos://<user-id>/<container>/<img-file-path>
157 157

  
158
    :returns: (<uuid>, <container>, <img-file-path>)
158
    :returns: (<user-id>, <container>, <img-file-path>)
159 159

  
160 160
    :raises AssertionError: if location is invalid
161 161
    """
......
163 163
    msg = 'Invalid prefix for location %s , try: %s' % (location, prefix)
164 164
    assert location.startswith(prefix), msg
165 165
    service, sep, rest = location.partition('://')
166
    assert sep and rest, 'Location %s is missing uuid' % location
166
    assert sep and rest, 'Location %s is missing user-id' % location
167 167
    uuid, sep, rest = rest.partition('/')
168 168
    assert sep and rest, 'Location %s is missing container' % location
169 169
    container, sep, img_path = rest.partition('/')
......
380 380
                'No image file location provided',
381 381
                importance=2, details=[
382 382
                    'An image location is needed. Image location format:',
383
                    '  pithos://<uuid>/<container>/<path>',
383
                    '  pithos://<user-id>/<container>/<path>',
384 384
                    ' an image file at the above location must exist.'
385 385
                    ] + howto_image_file)
386 386
        try:
......
390 390
                ae, 'Invalid image location format',
391 391
                importance=1, details=[
392 392
                    'Valid image location format:',
393
                    '  pithos://<uuid>/<container>/<img-file-path>'
393
                    '  pithos://<user-id>/<container>/<img-file-path>'
394 394
                    ] + howto_image_file)
395 395

  
396 396
    @errors.generic.all
b/kamaki/cli/commands/pithos.py
1217 1217
    If local destination is a directory:
1218 1218
    *   download <container>:<path> <local dir> -R
1219 1219
    will download all files on <container> prefixed as <path>,
1220
    to <local dir>/<full path>
1220
    to <local dir>/<full path> (or <local dir>\<full path> in windows)
1221 1221
    *   download <container>:<path> <local dir> --exact-match
1222 1222
    will download only one file, exactly matching <path>
1223 1223
    ATTENTION: to download cont:dir1/dir2/file there must exist objects
......
1730 1730
        detail=FlagArgument('show detailed output', ('-l', '--details')),
1731 1731
        until=DateArgument('show metadata until then', '--until'),
1732 1732
        object_version=ValueArgument(
1733
            'show specific version \ (applies only for objects)',
1733
            'show specific version (applies only for objects)',
1734 1734
            ('-O', '--object-version'))
1735 1735
    )
1736 1736

  
b/kamaki/cli/commands/snf-astakos.py
82 82
    """Authenticate a user
83 83
    Get user information (e.g. unique account name) from token
84 84
    Token should be set in settings:
85
    *  check if a token is set    /config get token
86
    *  permanently set a token    /config set token <token>
85
    *  check if a token is set    /config get remote.default.token
86
    *  permanently set a token    /config set remote.default.token <token>
87 87
    Token can also be provided as a parameter
88
    (To use a named cloud remote, use its name instead of "default")
88 89
    """
89 90

  
90 91
    arguments = dict(

Also available in: Unified diff