1
by Jesse Andrews
initial commit |
1 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
114
by Devin Carlen
Updated licenses |
2 |
|
3 |
# Copyright 2010 United States Government as represented by the
|
|
3.1.9
by Vishvananda Ishaya
Removed trailing whitespace from header |
4 |
# Administrator of the National Aeronautics and Space Administration.
|
114
by Devin Carlen
Updated licenses |
5 |
# All Rights Reserved.
|
6 |
#
|
|
7 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
8 |
# not use this file except in compliance with the License. You may obtain
|
|
9 |
# a copy of the License at
|
|
10 |
#
|
|
11 |
# http://www.apache.org/licenses/LICENSE-2.0
|
|
1
by Jesse Andrews
initial commit |
12 |
#
|
13 |
# Unless required by applicable law or agreed to in writing, software
|
|
114
by Devin Carlen
Updated licenses |
14 |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
15 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
16 |
# License for the specific language governing permissions and limitations
|
|
17 |
# under the License.
|
|
1
by Jesse Andrews
initial commit |
18 |
|
1005.4.1
by termie
docstring cleanup, nova dir |
19 |
"""Command-line flag library.
|
20 |
||
21 |
Wraps gflags.
|
|
22 |
||
1
by Jesse Andrews
initial commit |
23 |
Package-level global flags are defined here, the rest are defined
|
24 |
where they're used.
|
|
1005.4.1
by termie
docstring cleanup, nova dir |
25 |
|
1
by Jesse Andrews
initial commit |
26 |
"""
|
27 |
||
197.2.1
by andy
Add some useful features to our flags |
28 |
import getopt |
237.1.48
by Vishvananda Ishaya
network tests pass again |
29 |
import os |
1
by Jesse Andrews
initial commit |
30 |
import socket |
396.4.4
by Soren Hansen
Import string instead of importing Template from string. This is how we do things. |
31 |
import string |
197.2.1
by andy
Add some useful features to our flags |
32 |
import sys |
33 |
||
34 |
import gflags |
|
35 |
||
706.2.16
by Vishvananda Ishaya
fix pep8 and remove extra reference to reset |
36 |
|
197.2.1
by andy
Add some useful features to our flags |
37 |
class FlagValues(gflags.FlagValues): |
197.2.4
by andy
updated doc string and wrapper |
38 |
"""Extension of gflags.FlagValues that allows undefined and runtime flags.
|
39 |
||
40 |
Unknown flags will be ignored when parsing the command line, but the
|
|
41 |
command line will be kept so that it can be replayed if new flags are
|
|
42 |
defined after the initial parsing.
|
|
237.1.48
by Vishvananda Ishaya
network tests pass again |
43 |
|
197.2.4
by andy
updated doc string and wrapper |
44 |
"""
|
45 |
||
396.4.3
by Soren Hansen
Make sure templated flags work across calls to ParseNewFlags. |
46 |
def __init__(self, extra_context=None): |
197.2.1
by andy
Add some useful features to our flags |
47 |
gflags.FlagValues.__init__(self) |
48 |
self.__dict__['__dirty'] = [] |
|
49 |
self.__dict__['__was_already_parsed'] = False |
|
50 |
self.__dict__['__stored_argv'] = [] |
|
396.4.3
by Soren Hansen
Make sure templated flags work across calls to ParseNewFlags. |
51 |
self.__dict__['__extra_context'] = extra_context |
197.2.1
by andy
Add some useful features to our flags |
52 |
|
53 |
def __call__(self, argv): |
|
54 |
# We're doing some hacky stuff here so that we don't have to copy
|
|
55 |
# out all the code of the original verbatim and then tweak a few lines.
|
|
56 |
# We're hijacking the output of getopt so we can still return the
|
|
57 |
# leftover args at the end
|
|
58 |
sneaky_unparsed_args = {"value": None} |
|
59 |
original_argv = list(argv) |
|
237.1.48
by Vishvananda Ishaya
network tests pass again |
60 |
|
197.2.1
by andy
Add some useful features to our flags |
61 |
if self.IsGnuGetOpt(): |
62 |
orig_getopt = getattr(getopt, 'gnu_getopt') |
|
63 |
orig_name = 'gnu_getopt' |
|
64 |
else: |
|
65 |
orig_getopt = getattr(getopt, 'getopt') |
|
66 |
orig_name = 'getopt' |
|
67 |
||
68 |
def _sneaky(*args, **kw): |
|
69 |
optlist, unparsed_args = orig_getopt(*args, **kw) |
|
70 |
sneaky_unparsed_args['value'] = unparsed_args |
|
71 |
return optlist, unparsed_args |
|
72 |
||
73 |
try: |
|
74 |
setattr(getopt, orig_name, _sneaky) |
|
75 |
args = gflags.FlagValues.__call__(self, argv) |
|
76 |
except gflags.UnrecognizedFlagError: |
|
77 |
# Undefined args were found, for now we don't care so just
|
|
78 |
# act like everything went well
|
|
79 |
# (these three lines are copied pretty much verbatim from the end
|
|
80 |
# of the __call__ function we are wrapping)
|
|
81 |
unparsed_args = sneaky_unparsed_args['value'] |
|
82 |
if unparsed_args: |
|
83 |
if self.IsGnuGetOpt(): |
|
237.1.48
by Vishvananda Ishaya
network tests pass again |
84 |
args = argv[:1] + unparsed_args |
197.2.1
by andy
Add some useful features to our flags |
85 |
else: |
86 |
args = argv[:1] + original_argv[-len(unparsed_args):] |
|
87 |
else: |
|
88 |
args = argv[:1] |
|
89 |
finally: |
|
90 |
setattr(getopt, orig_name, orig_getopt) |
|
237.1.48
by Vishvananda Ishaya
network tests pass again |
91 |
|
197.2.1
by andy
Add some useful features to our flags |
92 |
# Store the arguments for later, we'll need them for new flags
|
93 |
# added at runtime
|
|
94 |
self.__dict__['__stored_argv'] = original_argv |
|
95 |
self.__dict__['__was_already_parsed'] = True |
|
96 |
self.ClearDirty() |
|
97 |
return args |
|
98 |
||
352.3.1
by Andy Smith
prevent leakage of FLAGS changes across tests |
99 |
def Reset(self): |
100 |
gflags.FlagValues.Reset(self) |
|
101 |
self.__dict__['__dirty'] = [] |
|
102 |
self.__dict__['__was_already_parsed'] = False |
|
103 |
self.__dict__['__stored_argv'] = [] |
|
104 |
||
197.2.1
by andy
Add some useful features to our flags |
105 |
def SetDirty(self, name): |
106 |
"""Mark a flag as dirty so that accessing it will case a reparse."""
|
|
107 |
self.__dict__['__dirty'].append(name) |
|
237.1.48
by Vishvananda Ishaya
network tests pass again |
108 |
|
197.2.1
by andy
Add some useful features to our flags |
109 |
def IsDirty(self, name): |
110 |
return name in self.__dict__['__dirty'] |
|
111 |
||
112 |
def ClearDirty(self): |
|
1104.1.1
by termie
Properly reparse flags when adding dynamic flags |
113 |
self.__dict__['__dirty'] = [] |
197.2.1
by andy
Add some useful features to our flags |
114 |
|
115 |
def WasAlreadyParsed(self): |
|
116 |
return self.__dict__['__was_already_parsed'] |
|
117 |
||
118 |
def ParseNewFlags(self): |
|
119 |
if '__stored_argv' not in self.__dict__: |
|
120 |
return
|
|
396.4.3
by Soren Hansen
Make sure templated flags work across calls to ParseNewFlags. |
121 |
new_flags = FlagValues(self) |
1104.1.1
by termie
Properly reparse flags when adding dynamic flags |
122 |
for k in self.FlagDict().iterkeys(): |
197.2.1
by andy
Add some useful features to our flags |
123 |
new_flags[k] = gflags.FlagValues.__getitem__(self, k) |
124 |
||
1104.1.2
by termie
add a test from vish and fix the issues |
125 |
new_flags.Reset() |
197.2.1
by andy
Add some useful features to our flags |
126 |
new_flags(self.__dict__['__stored_argv']) |
1104.1.1
by termie
Properly reparse flags when adding dynamic flags |
127 |
for k in new_flags.FlagDict().iterkeys(): |
197.2.1
by andy
Add some useful features to our flags |
128 |
setattr(self, k, getattr(new_flags, k)) |
129 |
self.ClearDirty() |
|
237.1.48
by Vishvananda Ishaya
network tests pass again |
130 |
|
197.2.1
by andy
Add some useful features to our flags |
131 |
def __setitem__(self, name, flag): |
132 |
gflags.FlagValues.__setitem__(self, name, flag) |
|
133 |
if self.WasAlreadyParsed(): |
|
134 |
self.SetDirty(name) |
|
237.1.48
by Vishvananda Ishaya
network tests pass again |
135 |
|
197.2.1
by andy
Add some useful features to our flags |
136 |
def __getitem__(self, name): |
137 |
if self.IsDirty(name): |
|
138 |
self.ParseNewFlags() |
|
139 |
return gflags.FlagValues.__getitem__(self, name) |
|
140 |
||
141 |
def __getattr__(self, name): |
|
142 |
if self.IsDirty(name): |
|
143 |
self.ParseNewFlags() |
|
396.4.1
by Soren Hansen
Add a templating mechanism in the flag parsing. Add a state_path flag that will be used as the top-level dir for all other state (such as images, instances, buckets, networks, etc). This way you only need to change one flag to put all your state in e.g. /var/lib/nova. |
144 |
val = gflags.FlagValues.__getattr__(self, name) |
145 |
if type(val) is str: |
|
396.4.4
by Soren Hansen
Import string instead of importing Template from string. This is how we do things. |
146 |
tmpl = string.Template(val) |
396.4.3
by Soren Hansen
Make sure templated flags work across calls to ParseNewFlags. |
147 |
context = [self, self.__dict__['__extra_context']] |
148 |
return tmpl.substitute(StrWrapper(context)) |
|
396.4.1
by Soren Hansen
Add a templating mechanism in the flag parsing. Add a state_path flag that will be used as the top-level dir for all other state (such as images, instances, buckets, networks, etc). This way you only need to change one flag to put all your state in e.g. /var/lib/nova. |
149 |
return val |
150 |
||
396.4.3
by Soren Hansen
Make sure templated flags work across calls to ParseNewFlags. |
151 |
|
396.4.1
by Soren Hansen
Add a templating mechanism in the flag parsing. Add a state_path flag that will be used as the top-level dir for all other state (such as images, instances, buckets, networks, etc). This way you only need to change one flag to put all your state in e.g. /var/lib/nova. |
152 |
class StrWrapper(object): |
1005.4.1
by termie
docstring cleanup, nova dir |
153 |
"""Wrapper around FlagValues objects.
|
396.4.3
by Soren Hansen
Make sure templated flags work across calls to ParseNewFlags. |
154 |
|
155 |
Wraps FlagValues objects for string.Template so that we're
|
|
1005.4.1
by termie
docstring cleanup, nova dir |
156 |
sure to return strings.
|
157 |
||
158 |
"""
|
|
396.4.3
by Soren Hansen
Make sure templated flags work across calls to ParseNewFlags. |
159 |
def __init__(self, context_objs): |
160 |
self.context_objs = context_objs |
|
396.4.1
by Soren Hansen
Add a templating mechanism in the flag parsing. Add a state_path flag that will be used as the top-level dir for all other state (such as images, instances, buckets, networks, etc). This way you only need to change one flag to put all your state in e.g. /var/lib/nova. |
161 |
|
162 |
def __getitem__(self, name): |
|
396.4.3
by Soren Hansen
Make sure templated flags work across calls to ParseNewFlags. |
163 |
for context in self.context_objs: |
164 |
val = getattr(context, name, False) |
|
165 |
if val: |
|
166 |
return str(val) |
|
167 |
raise KeyError(name) |
|
197.2.1
by andy
Add some useful features to our flags |
168 |
|
379.4.10
by Andy Smith
formatting and naming cleanup |
169 |
|
724.1.1
by termie
updates to nova.flags to get help working better |
170 |
# Copied from gflags with small mods to get the naming correct.
|
171 |
# Originally gflags checks for the first module that is not gflags that is
|
|
172 |
# in the call chain, we want to check for the first module that is not gflags
|
|
173 |
# and not this module.
|
|
174 |
def _GetCallingModule(): |
|
175 |
"""Returns the name of the module that's calling into this module.
|
|
176 |
||
177 |
We generally use this function to get the name of the module calling a
|
|
178 |
DEFINE_foo... function.
|
|
1005.4.1
by termie
docstring cleanup, nova dir |
179 |
|
724.1.1
by termie
updates to nova.flags to get help working better |
180 |
"""
|
181 |
# Walk down the stack to find the first globals dict that's not ours.
|
|
182 |
for depth in range(1, sys.getrecursionlimit()): |
|
183 |
if not sys._getframe(depth).f_globals is globals(): |
|
184 |
module_name = __GetModuleName(sys._getframe(depth).f_globals) |
|
185 |
if module_name == 'gflags': |
|
186 |
continue
|
|
187 |
if module_name is not None: |
|
188 |
return module_name |
|
189 |
raise AssertionError("No module was found") |
|
190 |
||
191 |
||
192 |
# Copied from gflags because it is a private function
|
|
193 |
def __GetModuleName(globals_dict): |
|
194 |
"""Given a globals dict, returns the name of the module that defines it.
|
|
195 |
||
196 |
Args:
|
|
197 |
globals_dict: A dictionary that should correspond to an environment
|
|
198 |
providing the values of the globals.
|
|
199 |
||
200 |
Returns:
|
|
201 |
A string (the name of the module) or None (if the module could not
|
|
202 |
be identified.
|
|
1005.4.1
by termie
docstring cleanup, nova dir |
203 |
|
724.1.1
by termie
updates to nova.flags to get help working better |
204 |
"""
|
205 |
for name, module in sys.modules.iteritems(): |
|
206 |
if getattr(module, '__dict__', None) is globals_dict: |
|
207 |
if name == '__main__': |
|
208 |
return sys.argv[0] |
|
209 |
return name |
|
210 |
return None |
|
197.2.1
by andy
Add some useful features to our flags |
211 |
|
212 |
||
197.2.4
by andy
updated doc string and wrapper |
213 |
def _wrapper(func): |
197.2.1
by andy
Add some useful features to our flags |
214 |
def _wrapped(*args, **kw): |
215 |
kw.setdefault('flag_values', FLAGS) |
|
216 |
func(*args, **kw) |
|
217 |
_wrapped.func_name = func.func_name |
|
218 |
return _wrapped |
|
219 |
||
220 |
||
724.1.1
by termie
updates to nova.flags to get help working better |
221 |
FLAGS = FlagValues() |
222 |
gflags.FLAGS = FLAGS |
|
223 |
gflags._GetCallingModule = _GetCallingModule |
|
224 |
||
225 |
||
242.2.1
by Soren Hansen
Use the argument handler specified by twistd, if any. |
226 |
DEFINE = _wrapper(gflags.DEFINE) |
197.2.4
by andy
updated doc string and wrapper |
227 |
DEFINE_string = _wrapper(gflags.DEFINE_string) |
228 |
DEFINE_integer = _wrapper(gflags.DEFINE_integer) |
|
229 |
DEFINE_bool = _wrapper(gflags.DEFINE_bool) |
|
230 |
DEFINE_boolean = _wrapper(gflags.DEFINE_boolean) |
|
231 |
DEFINE_float = _wrapper(gflags.DEFINE_float) |
|
232 |
DEFINE_enum = _wrapper(gflags.DEFINE_enum) |
|
233 |
DEFINE_list = _wrapper(gflags.DEFINE_list) |
|
234 |
DEFINE_spaceseplist = _wrapper(gflags.DEFINE_spaceseplist) |
|
235 |
DEFINE_multistring = _wrapper(gflags.DEFINE_multistring) |
|
236 |
DEFINE_multi_int = _wrapper(gflags.DEFINE_multi_int) |
|
379.4.1
by Andy Smith
part way through porting the codebase off of twisted |
237 |
DEFINE_flag = _wrapper(gflags.DEFINE_flag) |
238 |
HelpFlag = gflags.HelpFlag |
|
239 |
HelpshortFlag = gflags.HelpshortFlag |
|
240 |
HelpXMLFlag = gflags.HelpXMLFlag |
|
197.2.1
by andy
Add some useful features to our flags |
241 |
|
242 |
||
243 |
def DECLARE(name, module_string, flag_values=FLAGS): |
|
244 |
if module_string not in sys.modules: |
|
245 |
__import__(module_string, globals(), locals()) |
|
246 |
if name not in flag_values: |
|
247 |
raise gflags.UnrecognizedFlag( |
|
248 |
"%s not defined by %s" % (name, module_string)) |
|
249 |
||
1
by Jesse Andrews
initial commit |
250 |
|
531.4.1
by Vishvananda Ishaya
Moved get_my_ip into flags because that is the only thing it is being used for and use it to set a new flag called my_ip |
251 |
def _get_my_ip(): |
252 |
"""Returns the actual ip of the local machine."""
|
|
253 |
try: |
|
254 |
csock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) |
|
255 |
csock.connect(('8.8.8.8', 80)) |
|
256 |
(addr, port) = csock.getsockname() |
|
257 |
csock.close() |
|
258 |
return addr |
|
382.16.3
by rlane at wikimedia
Catching all socket errors in _get_my_ip, since any socket error is likely enough to cause a failure in detection. |
259 |
except socket.error as ex: |
531.4.1
by Vishvananda Ishaya
Moved get_my_ip into flags because that is the only thing it is being used for and use it to set a new flag called my_ip |
260 |
return "127.0.0.1" |
261 |
||
262 |
||
1
by Jesse Andrews
initial commit |
263 |
# __GLOBAL FLAGS ONLY__
|
264 |
# Define any app-specific flags in their own files, docs at:
|
|
531.4.1
by Vishvananda Ishaya
Moved get_my_ip into flags because that is the only thing it is being used for and use it to set a new flag called my_ip |
265 |
# http://code.google.com/p/python-gflags/source/browse/trunk/gflags.py#a9
|
266 |
DEFINE_string('my_ip', _get_my_ip(), 'host ip address') |
|
270.6.1
by Vishvananda Ishaya
multi-region flag for describe regions |
267 |
DEFINE_list('region_list', |
268 |
[],
|
|
529.1.3
by Vishvananda Ishaya
add test and fix describe regions |
269 |
'list of region=fqdn pairs separated by commas') |
145.1.4
by Ewan Mellor
First commit of XenAPI-specific code (i.e. connections to the open-source |
270 |
DEFINE_string('connection_type', 'libvirt', 'libvirt, xenapi or fake') |
413.3.1
by Josh Kearney
Make aws_access_key_id and aws_secret_access_key configurable |
271 |
DEFINE_string('aws_access_key_id', 'admin', 'AWS Access ID') |
272 |
DEFINE_string('aws_secret_access_key', 'admin', 'AWS Access Key') |
|
1164.1.1
by Rick Harris
Support multiple glance-api servers |
273 |
# NOTE(sirp): my_ip interpolation doesn't work within nested structures
|
274 |
DEFINE_list('glance_api_servers', |
|
1187.1.1
by Rick Harris
Glance host defaults to rather than localhost |
275 |
['%s:9292' % _get_my_ip()], |
1164.1.4
by Rick Harris
Fixing code per review comments |
276 |
'list of glance api servers available to nova (host:port)') |
1
by Jesse Andrews
initial commit |
277 |
DEFINE_integer('s3_port', 3333, 's3 port') |
531.4.1
by Vishvananda Ishaya
Moved get_my_ip into flags because that is the only thing it is being used for and use it to set a new flag called my_ip |
278 |
DEFINE_string('s3_host', '$my_ip', 's3 host (for infrastructure)') |
279 |
DEFINE_string('s3_dmz', '$my_ip', 's3 dmz ip (for instances)') |
|
1
by Jesse Andrews
initial commit |
280 |
DEFINE_string('compute_topic', 'compute', 'the topic compute nodes listen on') |
498.3.4
by Monsyne Dragon
Fix a bunch of pep8 stuff |
281 |
DEFINE_string('console_topic', 'console', |
282 |
'the topic console proxy nodes listen on') |
|
375.2.1
by Eric Day
PEP8 and pylint cleanup. There should be no functional changes here, just style changes to get violations down. |
283 |
DEFINE_string('scheduler_topic', 'scheduler', |
284 |
'the topic scheduler nodes listen on') |
|
153.2.2
by Vishvananda Ishaya
refactor daemons to use common base class in preparation for network refactor |
285 |
DEFINE_string('volume_topic', 'volume', 'the topic volume nodes listen on') |
286 |
DEFINE_string('network_topic', 'network', 'the topic network nodes listen on') |
|
205.2.30
by Anthony Young
some pep8 fixes |
287 |
DEFINE_string('ajax_console_proxy_topic', 'ajax_proxy', |
205.2.15
by Anthony Young
connecting ajax proxy to rabbit to allow token based security |
288 |
'the topic ajax proxy nodes listen on') |
205.2.16
by Anthony Young
working connection security |
289 |
DEFINE_string('ajax_console_proxy_url', |
205.2.37
by Anthony Young
pep8 fix, and add in flags that don't refernece my laptop |
290 |
'http://127.0.0.1:8000', |
291 |
'location of ajax console proxy, \ |
|
292 |
in the form "http://127.0.0.1:8000"') |
|
205.2.20
by Anthony Young
rewrite proxy to not use twisted |
293 |
DEFINE_string('ajax_console_proxy_port', |
205.2.37
by Anthony Young
pep8 fix, and add in flags that don't refernece my laptop |
294 |
8000, 'port that ajax_console_proxy binds') |
1279.3.1
by vladimir.p
VSA: first cut. merged with 1279 |
295 |
DEFINE_string('vsa_topic', 'vsa', 'the topic that nova-vsa service listens on') |
1
by Jesse Andrews
initial commit |
296 |
DEFINE_bool('verbose', False, 'show debug output') |
297 |
DEFINE_boolean('fake_rabbit', False, 'use a fake rabbit') |
|
238.1.1
by andy
rather comprehensive style fixes |
298 |
DEFINE_bool('fake_network', False, |
299 |
'should we use fake network devices and addresses') |
|
1
by Jesse Andrews
initial commit |
300 |
DEFINE_string('rabbit_host', 'localhost', 'rabbit host') |
301 |
DEFINE_integer('rabbit_port', 5672, 'rabbit port') |
|
1131.1.1
by Josh Kearney
Allow SSL AMQP connections. |
302 |
DEFINE_bool('rabbit_use_ssl', False, 'connect over SSL') |
1
by Jesse Andrews
initial commit |
303 |
DEFINE_string('rabbit_userid', 'guest', 'rabbit userid') |
304 |
DEFINE_string('rabbit_password', 'guest', 'rabbit password') |
|
305 |
DEFINE_string('rabbit_virtual_host', '/', 'rabbit virtual host') |
|
1500.2.14
by Chris Behrens
pep8 fixes |
306 |
DEFINE_integer('rabbit_retry_interval', 1, |
307 |
'rabbit connection retry interval to start') |
|
308 |
DEFINE_integer('rabbit_retry_backoff', 2, |
|
309 |
'rabbit connection retry backoff in seconds') |
|
310 |
DEFINE_integer('rabbit_max_retries', 0, |
|
311 |
'maximum rabbit connection attempts (0=try forever)') |
|
1
by Jesse Andrews
initial commit |
312 |
DEFINE_string('control_exchange', 'nova', 'the main exchange to connect to') |
1412.1.1
by Monsyne Dragon
Added durable option for nova rabbit queues |
313 |
DEFINE_boolean('rabbit_durable_queues', False, 'use durable queues') |
1251.1.1
by Josh Kearney
Add a flag to disable ec2 or osapi. |
314 |
DEFINE_list('enabled_apis', ['ec2', 'osapi'], |
315 |
'list of APIs to enable by default') |
|
515.11.16
by Todd Willey
Merge trunk and handle flagfiles with kid-gloves in nova-api. Rename some flags for clarity. |
316 |
DEFINE_string('ec2_host', '$my_ip', 'ip of api server') |
317 |
DEFINE_string('ec2_dmz_host', '$my_ip', 'internal ip of api server') |
|
318 |
DEFINE_integer('ec2_port', 8773, 'cloud controller port') |
|
319 |
DEFINE_string('ec2_scheme', 'http', 'prefix for ec2') |
|
320 |
DEFINE_string('ec2_path', '/services/Cloud', 'suffix for ec2') |
|
784.6.2
by Dan Prince
Add config for osapi_extensions_path. |
321 |
DEFINE_string('osapi_extensions_path', '/var/lib/nova/extensions', |
322 |
'default directory for nova extensions') |
|
515.11.16
by Todd Willey
Merge trunk and handle flagfiles with kid-gloves in nova-api. Rename some flags for clarity. |
323 |
DEFINE_string('osapi_host', '$my_ip', 'ip of api server') |
324 |
DEFINE_string('osapi_scheme', 'http', 'prefix for openstack') |
|
551.1.1
by Sandy Walsh
change novarc template from cc_port to osapi_port. Removed osapi_port from bin scripts. |
325 |
DEFINE_integer('osapi_port', 8774, 'OpenStack API port') |
1369.2.3
by Sandy Walsh
OS v1.1 is now the default into novarc |
326 |
DEFINE_string('osapi_path', '/v1.1/', 'suffix for openstack') |
784.7.3
by Naveed Massjouni
Paginated results should not include the item starting at marker. |
327 |
DEFINE_integer('osapi_max_limit', 1000, |
328 |
'max number of items returned in a collection response') |
|
1
by Jesse Andrews
initial commit |
329 |
|
466.7.6
by Rick Harris
Getting Snapshots to work with cloudservers command-line tool |
330 |
DEFINE_string('default_project', 'openstack', 'default project for openstack') |
238.1.1
by andy
rather comprehensive style fixes |
331 |
DEFINE_string('default_image', 'ami-11111', |
332 |
'default image to use, testing only') |
|
333 |
DEFINE_string('default_instance_type', 'm1.small', |
|
334 |
'default instance type to use, testing only') |
|
466.6.2
by Vishvananda Ishaya
merge trunk and upgrade to cheetah templating |
335 |
DEFINE_string('null_kernel', 'nokernel', |
336 |
'kernel image that indicates not to use a kernel,'
|
|
423.3.2
by Salvatore Orlando
raw instances can now be launched in xenapi (only as hvm at the moment) |
337 |
' but to use a raw disk image instead') |
1
by Jesse Andrews
initial commit |
338 |
|
995.3.3
by Vishvananda Ishaya
Fixes cloudpipe to get the proper ip address. |
339 |
DEFINE_integer('vpn_image_id', 0, 'integer id for cloudpipe vpn server') |
118.3.4
by Vishvananda Ishaya
fixed typo |
340 |
DEFINE_string('vpn_key_suffix', |
396.6.2
by Vishvananda Ishaya
add dmz to flags and change a couple defaults |
341 |
'-vpn', |
342 |
'Suffix to add to project name for vpn key and secgroups') |
|
118.3.2
by Vishvananda Ishaya
Use flag for vpn key suffix instead of hardcoded string |
343 |
|
164.1.6
by Todd Willey
Flag for SessionToken ttl setting. |
344 |
DEFINE_integer('auth_token_ttl', 3600, 'Seconds for auth tokens to linger') |
345 |
||
396.4.5
by Soren Hansen
Adjust state_path default setting so that api unit tests find things where they used to find them. |
346 |
DEFINE_string('state_path', os.path.join(os.path.dirname(__file__), '../'), |
396.4.1
by Soren Hansen
Add a templating mechanism in the flag parsing. Add a state_path flag that will be used as the top-level dir for all other state (such as images, instances, buckets, networks, etc). This way you only need to change one flag to put all your state in e.g. /var/lib/nova. |
347 |
"Top-level directory for maintaining nova's state") |
749.2.2
by Soren Hansen
Add a lock_path flag for lock files. |
348 |
DEFINE_string('lock_path', os.path.join(os.path.dirname(__file__), '../'), |
1005.4.1
by termie
docstring cleanup, nova dir |
349 |
'Directory for lock files') |
670.2.1
by Soren Hansen
Resurrect logdir option. |
350 |
DEFINE_string('logdir', None, 'output to a per-service log file in named ' |
351 |
'directory') |
|
1329.1.1
by Josh Kearney
Add a flag to set the default file mode of logs. |
352 |
DEFINE_integer('logfile_mode', 0644, 'Default file mode of the logs.') |
706.6.5
by Vishvananda Ishaya
use flags for sqlite db names and fix flags in dhcpbridge |
353 |
DEFINE_string('sqlite_db', 'nova.sqlite', 'file name for sqlite') |
1409.1.1
by Brian Lamar
Allows multiple MySQL connections to be maintained using eventlet's db_pool. |
354 |
DEFINE_integer('sql_pool_timeout', 30, |
355 |
'seconds to wait for connection from pool before erroring') |
|
356 |
DEFINE_integer('sql_min_pool_size', 10, |
|
357 |
'minimum number of SQL connections to pool') |
|
358 |
DEFINE_integer('sql_max_pool_size', 10, |
|
359 |
'maximum number of SQL connections to pool') |
|
237.1.48
by Vishvananda Ishaya
network tests pass again |
360 |
DEFINE_string('sql_connection', |
706.6.5
by Vishvananda Ishaya
use flags for sqlite db names and fix flags in dhcpbridge |
361 |
'sqlite:///$state_path/$sqlite_db', |
237.1.48
by Vishvananda Ishaya
network tests pass again |
362 |
'connection string for sql database') |
662.1.1
by Rick Harris
sql_idle_timeout should be an integer |
363 |
DEFINE_integer('sql_idle_timeout', |
364 |
3600, |
|
503.2.2
by Ryan Lucio
Converted the pool_recycle setting to be a flag with a default of 3600 seconds |
365 |
'timeout for idle sql database connections') |
513.1.1
by Josh Kearney
Fixes LP688545 |
366 |
DEFINE_integer('sql_max_retries', 12, 'sql connection attempts') |
367 |
DEFINE_integer('sql_retry_interval', 10, 'sql connection retry interval') |
|
237.1.48
by Vishvananda Ishaya
network tests pass again |
368 |
|
237.1.55
by Vishvananda Ishaya
moved network code into business layer |
369 |
DEFINE_string('compute_manager', 'nova.compute.manager.ComputeManager', |
370 |
'Manager for compute') |
|
498.3.1
by Monsyne Dragon
add in xs-console worker and tests. |
371 |
DEFINE_string('console_manager', 'nova.console.manager.ConsoleProxyManager', |
372 |
'Manager for console proxy') |
|
237.1.55
by Vishvananda Ishaya
moved network code into business layer |
373 |
DEFINE_string('network_manager', 'nova.network.manager.VlanManager', |
374 |
'Manager for network') |
|
379.3.1
by Vishvananda Ishaya
ISCSI Volume support |
375 |
DEFINE_string('volume_manager', 'nova.volume.manager.VolumeManager', |
237.1.55
by Vishvananda Ishaya
moved network code into business layer |
376 |
'Manager for volume') |
205.1.18
by Vishvananda Ishaya
scheduler + unittests |
377 |
DEFINE_string('scheduler_manager', 'nova.scheduler.manager.SchedulerManager', |
378 |
'Manager for scheduler') |
|
1279.3.25
by vladimir.p
returned vsa_manager, nova-manage arg and print changes |
379 |
DEFINE_string('vsa_manager', 'nova.vsa.manager.VsaManager', |
380 |
'Manager for vsa') |
|
1279.3.1
by vladimir.p
VSA: first cut. merged with 1279 |
381 |
DEFINE_string('vc_image_name', 'vc_image', |
382 |
'the VC image ID (for a VC image that exists in DB Glance)') |
|
383 |
# VSA constants and enums
|
|
384 |
DEFINE_string('default_vsa_instance_type', 'm1.small', |
|
385 |
'default instance type for VSA instances') |
|
386 |
DEFINE_integer('max_vcs_in_vsa', 32, |
|
387 |
'maxinum VCs in a VSA') |
|
388 |
DEFINE_integer('vsa_part_size_gb', 100, |
|
389 |
'default partition size for shared capacity') |
|
390 |
||
316.6.2
by jaypipes at gmail
Adds BaseImageService and flag to control image service loading. Adds unit test for local image service. |
391 |
# The service to use for image search and retrieval
|
1158.3.2
by Brian Waldon
further changes |
392 |
DEFINE_string('image_service', 'nova.image.glance.GlanceImageService', |
316.6.2
by jaypipes at gmail
Adds BaseImageService and flag to control image service loading. Adds unit test for local image service. |
393 |
'The service to use for retrieving and searching for images.') |
394 |
||
237.1.105
by Vishvananda Ishaya
more fixes from code review |
395 |
DEFINE_string('host', socket.gethostname(), |
396 |
'name of this node') |
|
237.1.55
by Vishvananda Ishaya
moved network code into business layer |
397 |
|
237.1.105
by Vishvananda Ishaya
more fixes from code review |
398 |
DEFINE_string('node_availability_zone', 'nova', |
399 |
'availability zone of this node') |
|
754.1.1
by Cerberus
Basic notifications drivers and tests |
400 |
|
754.1.3
by matt.dietz at rackspace
More unit tests and rabbit hooks |
401 |
DEFINE_string('notification_driver', |
754.1.18
by Cerberus
Merge prop changes |
402 |
'nova.notifier.no_op_notifier', |
754.1.1
by Cerberus
Basic notifications drivers and tests |
403 |
'Default driver for sending notifications') |
738.2.1
by Anthony Young
add a caching layer to the has_role call to increase performance |
404 |
DEFINE_list('memcached_servers', None, |
738.2.4
by Vishvananda Ishaya
merged trunk |
405 |
'Memcached servers or None for in process cache.') |
406 |
||
635.3.3
by Sandy Walsh
zone/info works |
407 |
DEFINE_string('zone_name', 'nova', 'name of this zone') |
635.5.18
by Sandy Walsh
Replaced capability flags with List |
408 |
DEFINE_list('zone_capabilities', |
409 |
['hypervisor=xenserver;kvm', 'os=linux;windows'], |
|
635.5.21
by Sandy Walsh
indenting cleanup |
410 |
'Key/Multi-value list representng capabilities of this zone') |
1063.6.4
by Sandy Walsh
getting closer to working select call |
411 |
DEFINE_string('build_plan_encryption_key', None, |
412 |
'128bit (hex) encryption key for scheduler build plans.') |
|
1304.5.1
by Nikolay Sokolov
Moved restaring instances from livbirt driver to ComputeManager. |
413 |
|
414 |
DEFINE_bool('start_guests_on_host_boot', False, |
|
415 |
'Whether to restart guests when the host reboots') |
|
1304.5.9
by Nikolay Sokolov
Fixed old libvirt semantics, added resume_guests_state_on_host_boot flag. |
416 |
DEFINE_bool('resume_guests_state_on_host_boot', False, |
417 |
'Whether to start guests, that was running before the host reboot') |
|
1380.3.2
by Thierry Carrez
Add run_as_root parameter to utils.execute, uses new sudo_helper FLAG to prefix command |
418 |
|
1380.3.10
by Thierry Carrez
Rename sudo_helper FLAG into root_helper |
419 |
DEFINE_string('root_helper', 'sudo', |
1380.3.2
by Thierry Carrez
Add run_as_root parameter to utils.execute, uses new sudo_helper FLAG to prefix command |
420 |
'Command prefix to use for running commands as root') |
1479.1.1
by Dan Prince
Move use_ipv6 into flags. Its used in multiple places (network manager and the OSAPI) and should be defined at the top level. |
421 |
|
1479.1.2
by Dan Prince
'use the ipv6' -- 'use ipv6' |
422 |
DEFINE_bool('use_ipv6', False, 'use ipv6') |
1450.7.10
by Nachi Ueno
Merged with trunk |
423 |
|
1450.7.1
by Nachi Ueno
Added monkey patching notification code function |
424 |
DEFINE_bool('monkey_patch', False, |
1450.7.7
by Nachi Ueno
Added Test Code, doc string, and fixed pip-requiresw |
425 |
'Whether to log monkey patching') |
1450.7.1
by Nachi Ueno
Added monkey patching notification code function |
426 |
|
427 |
DEFINE_list('monkey_patch_modules', |
|
1450.7.13
by Nachi Ueno
Fixed doc string |
428 |
['nova.api.ec2.cloud:nova.notifier.api.notify_decorator', |
429 |
'nova.compute.api:nova.notifier.api.notify_decorator'], |
|
430 |
'Module list representing monkey '
|
|
431 |
'patched module and decorator') |