On Fri, 2011-05-27 at 09:17 -0400, Chris Lalancette wrote:
On 05/27/11 - 10:06:48AM, Mark McLoughlin wrote:
> For consistency with other config and allow it to work if the config
> file is not found.
> ---
> imagefactory/ApplicationConfiguration.py | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/imagefactory/ApplicationConfiguration.py
b/imagefactory/ApplicationConfiguration.py
> index 6b0e5ea..212319c 100644
> --- a/imagefactory/ApplicationConfiguration.py
> +++ b/imagefactory/ApplicationConfiguration.py
> @@ -71,6 +71,7 @@ class ApplicationConfiguration(object):
> argparser.add_argument('--foreground', action='store_true',
default=False, help='Stay in the foreground and avoid launching a daemon. (default:
%(default)s)')
> argparser.add_argument('--config',
default='/etc/imagefactory.conf', help='Configuration file to use. (default:
%(default)s)')
> argparser.add_argument('--imgdir', default='/tmp',
help='Build image files in location specified. (default: %(default)s)')
> + argparser.add_argument('--ec2_build_style',
default='snapshot', help='Whether EC2 builds should be done snapshot or upload
style. (default: %(default)s)')
> argparser.add_argument('--timeout', type=int, default=3600,
help='Set the timeout period for image building in seconds. (default:
%(default)s)')
> argparser.add_argument('--tmpdir', default='/tmp',
help='Use the specified location for temporary files. (default: %(default)s)')
> group_qmf = argparser.add_argument_group(title='QMF agent',
description=qmf_description)
sloranz and I had a conversation on IRC last night that is relevant to this.
I suggested that it might be a good idea to start removing command-line
arguments in favor of putting things in the configuration file. Actually, more
generally I suggested making things like the build-style dynamic; that is, it
is specified on a per-build-request basis. I believe that is already the case
for the ec2-build-style, but there are other things it is not the case for.
Anyway, I think my preference here would be to move this to the config file.
But I think sloranz needs to weigh in here.
So, this is actually in the config file already
The problem the patch is fixing is to make sure we have sensible
defaults when the config file isn't found (e.g. when running from git)
The way that is done for everything else right now is with argparser.
I'm fine with completely revamping how this is done, but don't see the
harm in adding this fix in the meantime
Cheers,
Mark.