diff options
| author | Andy Smith <code@term.ie> | 2010-12-10 11:46:29 -0800 |
|---|---|---|
| committer | Andy Smith <code@term.ie> | 2010-12-10 11:46:29 -0800 |
| commit | e3aae367c2d449bfc25216865f37182953b535f4 (patch) | |
| tree | c7bacce0d21577041edcfa5a394d46f4f32d52ab /nova/compute | |
| parent | 4d06429290a373ae3a42b1f9b58d7253d269e048 (diff) | |
| parent | 1a759c3722610d720dd8dabf816db146c1063937 (diff) | |
merge-a-tat-tat upstream to this 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. |
