Removing requirement to pass kernel and ramdisk

This commit is contained in:
Rick Harris 2011-02-24 23:06:10 +00:00
parent b984af2d11
commit 78d7580b2c
2 changed files with 7 additions and 14 deletions

View File

@ -80,16 +80,14 @@ def parse_args():
def main():
args = parse_args()
meta = {'name': args.name, 'type': args.type, 'is_public': True}
meta = {'name': args.name, 'type': args.type, 'is_public': True,
'properties': {}}
# FIXME(sirp): remove kernel_id requirement when nova removes
# `null_kernel` concept
if args.kernel and args.ramdisk:
meta['properties'] = {'kernel_id': args.kernel,
'ramdisk_id': args.ramdisk}
else:
die("kernel and ramdisk required (use 'nokernel' and 'noramdisk' "
"to omit)")
if args.kernel:
meta['properties']['kernel_id'] = args.kernel
if args.ramdisk:
meta['properties']['ramdisk_id'] = args.ramdisk
client = Client(args.host, args.port)
with open(args.filename) as f:

View File

@ -153,12 +153,7 @@ sql_idle_timeout = 3600
"Could not find 'Image type is required' "
"in output: %s" % out)
# FIXME(sirp): Nova currently requires a `null_kernel` to be
# specified using the string 'nokernel'. This is slated to be
# removed shortly (within days of 2011-02-24). Once this is done,
# we can remove the required --kernel and --ramdisk options here.
cmd = "./bin/glance-upload --port=%(api_port)d "\
"--kernel=nokernel --ramdisk=noramdisk "\
"--type=invalid %(conf_file_name)s "\
"'my image'" % locals()