Revision 0156e40c snf-astakos-app/astakos/im/management/commands/service-update.py
b/snf-astakos-app/astakos/im/management/commands/service-update.py | ||
---|---|---|
46 | 46 |
help = "Modify service attributes" |
47 | 47 |
|
48 | 48 |
option_list = BaseCommand.option_list + ( |
49 |
make_option('--order', |
|
50 |
dest='order', |
|
51 |
metavar='NUM', |
|
52 |
default=None, |
|
53 |
help="Set service order"), |
|
54 | 49 |
make_option('--name', |
55 | 50 |
dest='name', |
56 | 51 |
default=None, |
57 | 52 |
help="Set service name"), |
58 |
make_option('--url', |
|
59 |
dest='url', |
|
60 |
default=None, |
|
61 |
help="Set service url"), |
|
62 |
make_option('--icon', |
|
63 |
dest='icon', |
|
53 |
make_option('--api-url', |
|
54 |
dest='api_url', |
|
64 | 55 |
default=None, |
65 |
help="Set service icon (displayed by cloudbar)"),
|
|
56 |
help="Set service API url"),
|
|
66 | 57 |
make_option('--auth-token', |
67 | 58 |
dest='auth_token', |
68 | 59 |
default=None, |
... | ... | |
84 | 75 |
raise CommandError("Service does not exist. You may run snf-mange " |
85 | 76 |
"service-list for available service IDs.") |
86 | 77 |
|
87 |
order = options.get('order') |
|
88 | 78 |
name = options.get('name') |
89 |
url = options.get('url') |
|
90 |
icon = options.get('icon') |
|
79 |
api_url = options.get('api_url') |
|
91 | 80 |
auth_token = options.get('auth_token') |
92 | 81 |
renew_token = options.get('renew_token') |
93 | 82 |
|
94 |
if order != None: |
|
95 |
service.order = order |
|
96 |
|
|
97 | 83 |
if name: |
98 | 84 |
service.name = name |
99 | 85 |
|
100 |
if url: |
|
101 |
service.url = url |
|
102 |
|
|
103 |
if icon: |
|
104 |
service.icon = icon |
|
86 |
if api_url: |
|
87 |
service.api_url = api_url |
|
105 | 88 |
|
106 | 89 |
if auth_token: |
107 | 90 |
service.auth_token = auth_token |
Also available in: Unified diff