~yolanda.robla/nova/precise-security

« back to all changes in this revision

Viewing changes to nova/compute/api.py

  • Committer: yolanda.robla at canonical
  • Date: 2013-04-24 12:24:03 UTC
  • mfrom: (1.1.58)
  • Revision ID: yolanda.robla@canonical.com-20130424122403-m2v1wv4fz672e480
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
166
166
 
167
167
        self.network_api = network_api or network.API()
168
168
        self.volume_api = volume_api or volume.API()
 
169
        self.sgh = utils.import_object(FLAGS.security_group_handler)
169
170
        super(API, self).__init__(**kwargs)
170
171
 
171
172
    def _check_injected_file_quota(self, context, injected_files):
724
725
                      'user_id': context.user_id,
725
726
                      'project_id': context.project_id}
726
727
            self.db.security_group_create(context, values)
 
728
            self.sgh.trigger_security_group_create_refresh(context, values)
727
729
 
728
730
    def trigger_security_group_rules_refresh(self, context, security_group_id):
729
731
        """Called when a rule is added to or removed from a security_group."""
1559
1561
        return {'url': connect_info['access_url']}
1560
1562
 
1561
1563
    @wrap_check_policy
1562
 
    def validate_vnc_console(self, context, instance_id, host, port):
 
1564
    def validate_vnc_console(self, context, instance_id, host, port,
 
1565
                             console_type):
1563
1566
        """Validate VNC Console for an instance."""
1564
1567
        instance = self.get(context, instance_id)
1565
1568
        output = self._call_compute_message('get_vnc_console',
1566
 
                                            context,
1567
 
                                            instance)
 
1569
                context,
 
1570
                instance,
 
1571
                params={"console_type": console_type})
1568
1572
        return (port == output['port'] and host == output['host'])
1569
1573
 
1570
1574
    @wrap_check_policy