Skip to content

Commit

Permalink
Check for config_nova flag before proceeding to provison
Browse files Browse the repository at this point in the history
nova.conf.

Change-Id: Ia949224b9e108e41856a28e92dae43ca658e9dd6
Closes-Bug: 1605480
  • Loading branch information
cijohnson committed Aug 2, 2016
1 parent 7bcffef commit 5617b8a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion contrail_provisioning/compute/common.py
Expand Up @@ -54,6 +54,7 @@ def __init__(self, compute_args, args_str=None):
else:
# Deduce the phy interface from ip, if configured
self.dev = self.get_device_by_ip(self.vhost_ip)
self.config_nova = not(getattr(self._args, 'no_nova_config', False))

def enable_kernel_core(self):
self.enable_kernel_core()
Expand Down Expand Up @@ -146,7 +147,8 @@ def fixup_contrail_vrouter_agent(self):
local("sudo sed 's@dev=.*@dev=%s@g;s@vgw_subnet_ip=.*@vgw_subnet_ip=%s@g;s@vgw_intf=.*@vgw_intf=%s@g' /etc/contrail/agent_param.tmpl > agent_param.new" %
(self.dev,vgw_public_subnet_str,vgw_intf_list_str))
local("sudo mv agent_param.new /etc/contrail/agent_param")
local("openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver")
if self.config_nova:
local("openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver")
else:
with lcd(self._temp_dir_name):
local("sudo sed 's/dev=.*/dev=%s/g' /etc/contrail/agent_param.tmpl > agent_param.new" % self.dev)
Expand Down
8 changes: 5 additions & 3 deletions contrail_provisioning/compute/openstack.py
Expand Up @@ -20,6 +20,9 @@ def __init__(self, compute_args, args_str=None):
self._args = compute_args

def fixup_nova_conf(self):
if not self.config_nova:
print "Skipping nova conf provisioning as requested."
return
with settings(warn_only = True):
if not self._args.vmware:
if self.pdist in ['Ubuntu']:
Expand Down Expand Up @@ -100,7 +103,6 @@ def fixup_config_files(self):

def run_services(self):
contrail_openstack = not(getattr(self._args, 'no_contrail_openstack', False))
config_nova = not(getattr(self._args, 'no_nova_config', False))
if contrail_openstack:
if self._fixed_qemu_conf:
if self.pdist in ['centos', 'fedora', 'redhat']:
Expand All @@ -113,7 +115,7 @@ def run_services(self):
# degradation for nova tables
local("sudo compute-server-setup.sh")
else:
if config_nova:
if self.config_nova:
#use contrail specific vif driver
local('openstack-config --set /etc/nova/nova.conf DEFAULT libvirt_vif_driver nova_contrail_vif.contrailvif.VRouterVIFDriver')
# Use noopdriver for firewall
Expand All @@ -138,7 +140,7 @@ def run_services(self):
nova_compute = 'openstack-nova-compute'
if self.pdist in ['Ubuntu']:
nova_compute = 'nova-compute'
if config_nova:
if self.config_nova:
local('chkconfig %s on' % nova_compute)
local('service %s restart' % nova_compute)
super(ComputeOpenstackSetup, self).run_services()
Expand Down
7 changes: 4 additions & 3 deletions contrail_provisioning/compute/upgrade.py
Expand Up @@ -87,10 +87,11 @@ def upgrade(self):
self.disable_apt_get_auto_start()
self._upgrade()
if ((self.pdist not in ['Ubuntu']) and
('running' in local('service supervisor-vrouter status', capture=True))):
('running' in local('service supervisor-vrouter status',
capture=True))):
local("service supervisor-vrouter stop")
nova_config = not(getattr(self._args, 'no_nova_config', False))
if (nova_config and self._args.orchestrator == 'openstack'):
if (self.compute_setup.config_nova and
self._args.orchestrator == 'openstack'):
if self._args.from_rel == LooseVersion('2.00'):
self.fix_nova_params()
# Seperate contrail-<role>-nodemgr.conf is introduced from release 2.20
Expand Down

0 comments on commit 5617b8a

Please sign in to comment.