Revision 2d0b6dcc kamaki/cli.py
b/kamaki/cli.py | ||
---|---|---|
73 | 73 |
from base64 import b64encode |
74 | 74 |
from grp import getgrgid |
75 | 75 |
from optparse import OptionParser |
76 |
from os.path import abspath, basename, exists, expanduser
|
|
76 |
from os.path import abspath, basename, exists |
|
77 | 77 |
from pwd import getpwuid |
78 | 78 |
from sys import argv, exit, stdout |
79 | 79 |
|
... | ... | |
89 | 89 |
from kamaki.utils import OrderedDict, print_addresses, print_dict, print_items |
90 | 90 |
|
91 | 91 |
|
92 |
# Path to the file that stores the configuration |
|
93 |
CONFIG_PATH = expanduser('~/.kamakirc') |
|
94 |
|
|
95 |
# Name of a shell variable to bypass the CONFIG_PATH value |
|
96 |
CONFIG_ENV = 'KAMAKI_CONFIG' |
|
97 |
|
|
98 |
|
|
99 | 92 |
_commands = OrderedDict() |
100 | 93 |
|
101 | 94 |
|
... | ... | |
878 | 871 |
exit(0) |
879 | 872 |
|
880 | 873 |
if '--config' in args: |
881 |
config_path = args.grouped['--config'].get(0)
|
|
874 |
config = Config(args.grouped['--config'].get(0))
|
|
882 | 875 |
else: |
883 |
config_path = os.environ.get(CONFIG_ENV, CONFIG_PATH) |
|
884 |
|
|
885 |
config = Config(config_path) |
|
886 |
|
|
876 |
config = Config() |
|
877 |
|
|
887 | 878 |
for option in args.grouped.get('-o', []): |
888 | 879 |
keypath, sep, val = option.partition('=') |
889 | 880 |
if not sep: |
Also available in: Unified diff