summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKei Masumoto <masumotok@nttdata.co.jp>2011-07-13 14:38:15 +0900
committerKei Masumoto <masumotok@nttdata.co.jp>2011-07-13 14:38:15 +0900
commitca92390f83850b75d447c9ecd2e4b8b4c50534ab (patch)
tree50912c519abb73e02ec4c3acf5773d812b4d1df3
parent840c3e05c6c293810b1af0eacc5bea9942155c1b (diff)
parent11611716e30f368df77816b40c4c77de0e0e047f (diff)
fix reviewer's comment
-rw-r--r--Authors1
-rw-r--r--nova/network/manager.py12
-rw-r--r--nova/scheduler/manager.py6
3 files changed, 12 insertions, 7 deletions
diff --git a/Authors b/Authors
index d2b1b627c..4aa65eea2 100644
--- a/Authors
+++ b/Authors
@@ -1,4 +1,5 @@
Alex Meade <alex.meade@rackspace.com>
+Alexander Sakhnov <asakhnov@mirantis.com>
Andrey Brindeyev <abrindeyev@griddynamics.com>
Andy Smith <code@term.ie>
Andy Southgate <andy.southgate@citrix.com>
diff --git a/nova/network/manager.py b/nova/network/manager.py
index d7ac460ae..21d151033 100644
--- a/nova/network/manager.py
+++ b/nova/network/manager.py
@@ -124,7 +124,7 @@ class RPCAllocateFixedIP(object):
used since they share code to RPC.call allocate_fixed_ip on the
correct network host to configure dnsmasq
"""
- def _allocate_fixed_ips(self, context, instance_id, networks):
+ def _allocate_fixed_ips(self, context, instance_id, networks, **kwargs):
"""Calls allocate_fixed_ip once for each network."""
green_pool = greenpool.GreenPool()
@@ -136,13 +136,15 @@ class RPCAllocateFixedIP(object):
args = {}
args['instance_id'] = instance_id
args['network_id'] = network['id']
+ args['vpn'] = kwargs.pop('vpn')
green_pool.spawn_n(rpc.call, context, topic,
{'method': '_rpc_allocate_fixed_ip',
'args': args})
else:
# i am the correct host, run here
- self.allocate_fixed_ip(context, instance_id, network)
+ self.allocate_fixed_ip(context, instance_id, network,
+ vpn=kwargs.pop('vpn'))
# wait for all of the allocates (if any) to finish
green_pool.waitall()
@@ -371,13 +373,14 @@ class NetworkManager(manager.SchedulerDependentManager):
instance_id = kwargs.pop('instance_id')
project_id = kwargs.pop('project_id')
type_id = kwargs.pop('instance_type_id')
+ vpn = kwargs.pop('vpn')
admin_context = context.elevated()
LOG.debug(_("network allocations for instance %s"), instance_id,
context=context)
networks = self._get_networks_for_instance(admin_context, instance_id,
project_id)
self._allocate_mac_addresses(context, instance_id, networks)
- self._allocate_fixed_ips(admin_context, instance_id, networks)
+ self._allocate_fixed_ips(admin_context, instance_id, networks, vpn=vpn)
return self.get_instance_nw_info(context, instance_id, type_id)
def deallocate_for_instance(self, context, **kwargs):
@@ -646,7 +649,7 @@ class NetworkManager(manager.SchedulerDependentManager):
'address': address,
'reserved': reserved})
- def _allocate_fixed_ips(self, context, instance_id, networks):
+ def _allocate_fixed_ips(self, context, instance_id, networks, **kwargs):
"""Calls allocate_fixed_ip once for each network."""
raise NotImplementedError()
@@ -812,6 +815,7 @@ class VlanManager(RPCAllocateFixedIP, FloatingIP, NetworkManager):
address = self.db.fixed_ip_associate_pool(context,
network['id'],
instance_id)
+
vif = self.db.virtual_interface_get_by_instance_and_network(context,
instance_id,
network['id'])
diff --git a/nova/scheduler/manager.py b/nova/scheduler/manager.py
index 6b1adbf45..faef77154 100644
--- a/nova/scheduler/manager.py
+++ b/nova/scheduler/manager.py
@@ -119,9 +119,9 @@ class SchedulerManager(manager.Manager):
:returns:
example format is below.
{'resource':D, 'usage':{proj_id1:D, proj_id2:D}}
- D: {'vcpus':3, 'memory_mb':2048, 'local_gb':2048,
- 'vcpus_used': 12, 'memory_mb': 10240,
- 'local_gb': 64}
+ D: {'vcpus': 3, 'memory_mb': 2048, 'local_gb': 2048,
+ 'vcpus_used': 12, 'memory_mb_used': 10240,
+ 'local_gb_used': 64}
"""