summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorSoren Hansen <soren.hansen@rackspace.com>2010-07-27 11:10:19 +0200
committerSoren Hansen <soren.hansen@rackspace.com>2010-07-27 11:10:19 +0200
commitc4ffa57d4076b4aa5ed6262cdc2fece731b6875d (patch)
tree83267302ef3792aa5f0273beff3e5257cda4bf7f /nova/compute
parent9641dac5d0cbfd8d1f3026e1bae5749b9d8e00fc (diff)
parentfae70b1a769f52cc4730e04fcec8fe82cc8bd1c6 (diff)
downloadnova-c4ffa57d4076b4aa5ed6262cdc2fece731b6875d.tar.gz
nova-c4ffa57d4076b4aa5ed6262cdc2fece731b6875d.tar.xz
nova-c4ffa57d4076b4aa5ed6262cdc2fece731b6875d.zip
Merge with trunk.
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/disk.py3
-rw-r--r--nova/compute/linux_net.py2
-rw-r--r--nova/compute/network.py14
-rw-r--r--nova/compute/node.py5
4 files changed, 12 insertions, 12 deletions
diff --git a/nova/compute/disk.py b/nova/compute/disk.py
index 7e31498e5..1ffcca685 100644
--- a/nova/compute/disk.py
+++ b/nova/compute/disk.py
@@ -40,7 +40,8 @@ def partition(infile, outfile, local_bytes=0, local_type='ext2', execute=None):
formatted as ext2.
In the diagram below, dashes represent drive sectors.
- 0 a b c d e
+ +-----+------. . .-------+------. . .------+
+ | 0 a| b c|d e|
+-----+------. . .-------+------. . .------+
| mbr | primary partiton | local partition |
+-----+------. . .-------+------. . .------+
diff --git a/nova/compute/linux_net.py b/nova/compute/linux_net.py
index 48e07da66..861ce779b 100644
--- a/nova/compute/linux_net.py
+++ b/nova/compute/linux_net.py
@@ -29,7 +29,7 @@ from nova import flags
FLAGS=flags.FLAGS
flags.DEFINE_string('dhcpbridge_flagfile',
- '/etc/nova-dhcpbridge.conf',
+ '/etc/nova/nova-dhcpbridge.conf',
'location of flagfile for dhcpbridge')
def execute(cmd, addl_env=None):
diff --git a/nova/compute/network.py b/nova/compute/network.py
index 43011f696..b5b3c3b5d 100644
--- a/nova/compute/network.py
+++ b/nova/compute/network.py
@@ -29,7 +29,7 @@ from nova import datastore
from nova import exception
from nova import flags
from nova import utils
-from nova.auth import users
+from nova.auth import manager
from nova.compute import exception as compute_exception
from nova.compute import linux_net
@@ -210,11 +210,11 @@ class BaseNetwork(datastore.BasicModel):
@property
def user(self):
- return users.UserManager.instance().get_user(self['user_id'])
+ return manager.AuthManager().get_user(self['user_id'])
@property
def project(self):
- return users.UserManager.instance().get_project(self['project_id'])
+ return manager.AuthManager().get_project(self['project_id'])
@property
def _hosts_key(self):
@@ -516,7 +516,7 @@ def get_vlan_for_project(project_id):
if not known_vlans.has_key(vstr):
return Vlan.create(project_id, vnum)
old_project_id = known_vlans[vstr]
- if not users.UserManager.instance().get_project(old_project_id):
+ if not manager.AuthManager().get_project(old_project_id):
vlan = Vlan.lookup(old_project_id)
if vlan:
# NOTE(todd): This doesn't check for vlan id match, because
@@ -542,7 +542,7 @@ def get_network_by_interface(iface, security_group='default'):
def get_network_by_address(address):
logging.debug("Get Network By Address: %s" % address)
- for project in users.UserManager.instance().get_projects():
+ for project in manager.AuthManager().get_projects():
net = get_project_network(project.id)
if address in net.assigned:
logging.debug("Found %s in %s" % (address, project.id))
@@ -582,7 +582,7 @@ def get_project_network(project_id, security_group='default'):
""" get a project's private network, allocating one if needed """
# TODO(todd): It looks goofy to get a project from a UserManager.
# Refactor to still use the LDAP backend, but not User specific.
- project = users.UserManager.instance().get_project(project_id)
+ project = manager.AuthManager().get_project(project_id)
if not project:
raise exception.Error("Project %s doesn't exist, uhoh." %
project_id)
@@ -592,5 +592,5 @@ def get_project_network(project_id, security_group='default'):
def restart_nets():
""" Ensure the network for each user is enabled"""
- for project in users.UserManager.instance().get_projects():
+ for project in manager.AuthManager().get_projects():
get_project_network(project.id).express()
diff --git a/nova/compute/node.py b/nova/compute/node.py
index a44583c06..772373061 100644
--- a/nova/compute/node.py
+++ b/nova/compute/node.py
@@ -47,8 +47,7 @@ from nova import fakevirt
from nova import flags
from nova import process
from nova import utils
-from nova.auth import signer
-from nova.auth.users import UserManager
+from nova.auth import signer, manager
from nova.compute import disk
from nova.compute import model
from nova.compute import network
@@ -462,7 +461,7 @@ class Instance(object):
headers['Date'] = time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime())
user_id = self.datamodel['user_id']
- user = UserManager.instance().get_user(user_id)
+ user = manager.AuthManager().get_user(user_id)
uri = '/' + url.partition('/')[2]
auth = signer.Signer(user.secret.encode()).s3_authorization(headers, 'GET', uri)
headers['Authorization'] = 'AWS %s:%s' % (user.access, auth)