~ubuntu-branches/ubuntu/saucy/nova/saucy-proposed

« back to all changes in this revision

Viewing changes to nova/network/security_group/openstack_driver.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman
  • Date: 2013-02-22 09:27:29 UTC
  • mfrom: (1.1.68)
  • Revision ID: package-import@ubuntu.com-20130222092729-nn3gt8rf97uvts77
Tags: 2013.1.g3-0ubuntu1
[ Chuck Short ]
* New usptream release. 
* debian/patches/debian/patches/fix-ubuntu-tests.patch: Refreshed.
* debian/nova-baremetal.logrotate: Fix logfile path.
* debian/control, debian/nova-spiceproxy.{install, logrotate, upstart}:
  Add spice html5 proxy support.
* debian/nova-novncproxy.upstart: Start on runlevel [2345]
* debian/rules: Call testr directly since run_tests.sh -N gives weird return
  value when tests pass.
* debian/pyddist-overrides: Add websockify.
* debian/nova-common.postinst: Removed config file conversion, since
  the option is no longer available. (LP: #1110567)
* debian/control: Add python-pyasn1 as a dependency.
* debian/control: Add python-oslo-config as a dependency.
* debian/control: Suggest sysfsutils, sg3-utils, multipath-tools for fibre
  channel support.

[ Adam Gandelman ]
* debian/control: Fix typo (websocikfy -> websockify).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
 
2
 
 
3
# Copyright 2013 Nicira, Inc.
 
4
# All Rights Reserved
 
5
#
 
6
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 
7
#    not use this file except in compliance with the License. You may obtain
 
8
#    a copy of the License at
 
9
#
 
10
#         http://www.apache.org/licenses/LICENSE-2.0
 
11
#
 
12
#    Unless required by applicable law or agreed to in writing, software
 
13
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
14
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
15
#    License for the specific language governing permissions and limitations
 
16
#    under the License.
 
17
#
 
18
# @author: Aaron Rosen, Nicira Networks, Inc.
 
19
 
 
20
from oslo.config import cfg
 
21
 
 
22
from nova.openstack.common import importutils
 
23
 
 
24
security_group_opts = [
 
25
    cfg.StrOpt('security_group_api',
 
26
               default='nova',
 
27
               help='The full class name of the security API class'),
 
28
    cfg.StrOpt('security_group_handler',
 
29
               default='nova.network.sg.NullSecurityGroupHandler',
 
30
               help='The full class name of the security group handler class'),
 
31
]
 
32
 
 
33
CONF = cfg.CONF
 
34
CONF.register_opts(security_group_opts)
 
35
 
 
36
NOVA_DRIVER = ('nova.api.openstack.compute.contrib.security_groups.'
 
37
               'NativeNovaSecurityGroupAPI')
 
38
QUANTUM_DRIVER = ('nova.api.openstack.compute.contrib.security_groups.'
 
39
                  'NativeQuantumSecurityGroupAPI')
 
40
 
 
41
 
 
42
def get_openstack_security_group_driver():
 
43
    if CONF.security_group_api.lower() == 'nova':
 
44
        return importutils.import_object(NOVA_DRIVER)
 
45
    elif CONF.security_group_api.lower() == 'quantum':
 
46
        return importutils.import_object(QUANTUM_DRIVER)
 
47
    else:
 
48
        return importutils.import_object(CONF.security_group_api)
 
49
 
 
50
 
 
51
def get_security_group_handler():
 
52
    return importutils.import_object(CONF.security_group_handler)
 
53
 
 
54
 
 
55
def is_quantum_security_groups():
 
56
    if CONF.security_group_api.lower() == "quantum":
 
57
        return True
 
58
    else:
 
59
        return False