diff options
| author | Trey Morris <trey.morris@rackspace.com> | 2010-12-09 17:25:57 +0000 |
|---|---|---|
| committer | Trey Morris <trey.morris@rackspace.com> | 2010-12-09 17:25:57 +0000 |
| commit | 48d10e0aa0cbbbbadd022c020bca1695f50003da (patch) | |
| tree | 1a258f545f0e1c1f756dfce1e1c4455d7274c0ad /nova/compute | |
| parent | 5f72a004dee0cb8de3f2daee1976fa978f6e51f3 (diff) | |
| parent | 94edf2329a1077e76cff32892d37f285ebd26a36 (diff) | |
merging sandy's branch
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index cb23dae55..8e0efa4cc 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -55,9 +55,8 @@ class ComputeAPI(base.Base): def create_instances(self, context, instance_type, image_id, min_count=1, max_count=1, kernel_id=None, ramdisk_id=None, - display_name='', description='', user_data='', - key_name=None, key_data=None, - security_group='default', + display_name='', description='', key_name=None, + key_data=None, security_group='default', generate_hostname=generate_default_hostname): """Create the number of instances requested if quote and other arguments check out ok.""" @@ -158,8 +157,8 @@ class ComputeAPI(base.Base): {"method": "setup_fixed_ip", "args": {"address": address}}) - logging.debug("Casting to scheduler for %s/%s's instance %s" % - (context.project_id, context.user_id, instance_id)) + logging.debug("Casting to scheduler for %s/%s's instance %s", + context.project_id, context.user_id, instance_id) rpc.cast(context, FLAGS.scheduler_topic, {"method": "run_instance", @@ -169,6 +168,12 @@ class ComputeAPI(base.Base): return instances def ensure_default_security_group(self, context): + """ Create security group for the security context if it + does not already exist + + :param context: the security context + + """ try: db.security_group_get_by_name(context, context.project_id, 'default') @@ -177,7 +182,7 @@ class ComputeAPI(base.Base): 'description': 'default', 'user_id': context.user_id, 'project_id': context.project_id} - group = db.security_group_create(context, values) + db.security_group_create(context, values) def update_instance(self, context, instance_id, **kwargs): """Updates the instance in the datastore. |
