Revision 57ecec97
b/kamaki/cli/commands/config_cli.py | ||
---|---|---|
32 | 32 |
# or implied, of GRNET S.A. |
33 | 33 |
|
34 | 34 |
from kamaki.cli import command |
35 |
from kamaki.cli.argument import FlagArgument |
|
36 | 35 |
from kamaki.cli.commands import _command_init |
37 | 36 |
from kamaki.cli.command_tree import CommandTree |
38 | 37 |
|
... | ... | |
44 | 43 |
class config_list(_command_init): |
45 | 44 |
"""List configuration options""" |
46 | 45 |
|
47 |
def __init__(self, arguments={}): |
|
48 |
super(config_list, self).__init__(arguments) |
|
49 |
self.arguments['all'] = FlagArgument('include default values', '-a') |
|
50 |
|
|
51 | 46 |
def main(self): |
52 |
include_defaults = self.get_argument('all') |
|
53 | 47 |
for section in sorted(self.config.sections()): |
54 |
items = self.config.items(section, include_defaults)
|
|
48 |
items = self.config.items(section) |
|
55 | 49 |
for key, val in sorted(items): |
56 | 50 |
print('%s.%s = %s' % (section, key, val)) |
57 | 51 |
|
b/kamaki/cli/config.py | ||
---|---|---|
134 | 134 |
except NoSectionError: |
135 | 135 |
pass |
136 | 136 |
|
137 |
def items(self, section, include_defaults=False):
|
|
137 |
def items(self, section, include_defaults=True):
|
|
138 | 138 |
try: |
139 | 139 |
d = dict(DEFAULTS[section]) if include_defaults else {} |
140 | 140 |
except KeyError: |
Also available in: Unified diff