Bulk copy files to /etc/neutron
This commit is contained in:
parent
e81544c224
commit
b8cd0419f0
@ -863,178 +863,19 @@ def git_pre_install():
|
|||||||
def git_post_install(projects_yaml):
|
def git_post_install(projects_yaml):
|
||||||
"""Perform post-install setup."""
|
"""Perform post-install setup."""
|
||||||
src_etc = os.path.join(git_src_dir(projects_yaml, 'neutron'), 'etc')
|
src_etc = os.path.join(git_src_dir(projects_yaml, 'neutron'), 'etc')
|
||||||
etc_configs = {
|
configs = [
|
||||||
'api-paste': {
|
{'src': src_etc,
|
||||||
'src': os.path.join(src_etc, 'api-paste.ini'),
|
'dest': '/etc/neutron'},
|
||||||
'dest': '/etc/neutron/api-paste.ini',
|
{'src': os.path.join(src_etc, 'neutron/plugins'),
|
||||||
},
|
'dest': '/etc/neutron/plugins'},
|
||||||
'dhcp_agent': {
|
{'src': os.path.join(src_etc, 'neutron/rootwrap.d'),
|
||||||
'src': os.path.join(src_etc, 'dhcp_agent.ini'),
|
'dest': '/etc/neutron/rootwrap.d'},
|
||||||
'dest': '/etc/neutron/dhcp_agent.ini',
|
]
|
||||||
},
|
|
||||||
'fwaas_driver': {
|
|
||||||
'src': os.path.join(src_etc, 'fwaas_driver.ini'),
|
|
||||||
'dest': '/etc/neutron/fwaas_driver.ini',
|
|
||||||
},
|
|
||||||
'l3_agent': {
|
|
||||||
'src': os.path.join(src_etc, 'l3_agent.ini'),
|
|
||||||
'dest': '/etc/neutron/l3_agent.ini',
|
|
||||||
},
|
|
||||||
'lbaas_agent': {
|
|
||||||
'src': os.path.join(src_etc, 'lbaas_agent.ini'),
|
|
||||||
'dest': '/etc/neutron/lbaas_agent.ini',
|
|
||||||
},
|
|
||||||
'metadata_agent': {
|
|
||||||
'src': os.path.join(src_etc, 'metadata_agent.ini'),
|
|
||||||
'dest': '/etc/neutron/metadata_agent.ini',
|
|
||||||
},
|
|
||||||
'metering_agent': {
|
|
||||||
'src': os.path.join(src_etc, 'metering_agent.ini'),
|
|
||||||
'dest': '/etc/neutron/metering_agent.ini',
|
|
||||||
},
|
|
||||||
'policy': {
|
|
||||||
'src': os.path.join(src_etc, 'policy.json'),
|
|
||||||
'dest': '/etc/neutron/policy.json',
|
|
||||||
},
|
|
||||||
'rootwrap': {
|
|
||||||
'src': os.path.join(src_etc, 'rootwrap.conf'),
|
|
||||||
'dest': '/etc/neutron/rootwrap.conf',
|
|
||||||
},
|
|
||||||
'vpn_agent': {
|
|
||||||
'src': os.path.join(src_etc, 'vpn_agent.ini'),
|
|
||||||
'dest': '/etc/neutron/vpn_agent.ini',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for conf, files in etc_configs.iteritems():
|
for c in configs:
|
||||||
if os.path.exists(files['src']):
|
if os.path.exists(c['dest']):
|
||||||
shutil.copyfile(files['src'], files['dest'])
|
shutil.rmtree(c['dest'])
|
||||||
|
shutil.copytree(c['src'], c['dest'])
|
||||||
src_plugins = os.path.join(src_etc, 'neutron/plugins')
|
|
||||||
plugins_configs = {
|
|
||||||
'bigswitch': {
|
|
||||||
'src': os.path.join(src_plugins, 'bigswitch'),
|
|
||||||
'dest': '/etc/neutron/plugins/bigswitch',
|
|
||||||
},
|
|
||||||
'brocade': {
|
|
||||||
'src': os.path.join(src_plugins, 'brocade'),
|
|
||||||
'dest': '/etc/neutron/plugins/brocade',
|
|
||||||
},
|
|
||||||
'cisco': {
|
|
||||||
'src': os.path.join(src_plugins, 'cisco'),
|
|
||||||
'dest': '/etc/neutron/plugins/cisco',
|
|
||||||
},
|
|
||||||
'hyperv': {
|
|
||||||
'src': os.path.join(src_plugins, 'hyperv'),
|
|
||||||
'dest': '/etc/neutron/plugins/hyperv',
|
|
||||||
},
|
|
||||||
'ibm': {
|
|
||||||
'src': os.path.join(src_plugins, 'ibm'),
|
|
||||||
'dest': '/etc/neutron/plugins/ibm',
|
|
||||||
},
|
|
||||||
'metaplugin': {
|
|
||||||
'src': os.path.join(src_plugins, 'metaplugin'),
|
|
||||||
'dest': '/etc/neutron/plugins/metaplugin',
|
|
||||||
},
|
|
||||||
'midonet': {
|
|
||||||
'src': os.path.join(src_plugins, 'midonet'),
|
|
||||||
'dest': '/etc/neutron/plugins/midonet',
|
|
||||||
},
|
|
||||||
'ml2': {
|
|
||||||
'src': os.path.join(src_plugins, 'ml2'),
|
|
||||||
'dest': '/etc/neutron/plugins/ml2',
|
|
||||||
},
|
|
||||||
'mlnx': {
|
|
||||||
'src': os.path.join(src_plugins, 'mlnx'),
|
|
||||||
'dest': '/etc/neutron/plugins/mlnx',
|
|
||||||
},
|
|
||||||
'nec': {
|
|
||||||
'src': os.path.join(src_plugins, 'nec'),
|
|
||||||
'dest': '/etc/neutron/plugins/nec',
|
|
||||||
},
|
|
||||||
'nuage': {
|
|
||||||
'src': os.path.join(src_plugins, 'nuage'),
|
|
||||||
'dest': '/etc/neutron/plugins/nuage',
|
|
||||||
},
|
|
||||||
'oneconvergence': {
|
|
||||||
'src': os.path.join(src_plugins, 'oneconvergence'),
|
|
||||||
'dest': '/etc/neutron/plugins/oneconvergence',
|
|
||||||
},
|
|
||||||
'opencontrail': {
|
|
||||||
'src': os.path.join(src_plugins, 'opencontrail'),
|
|
||||||
'dest': '/etc/neutron/plugins/opencontrail',
|
|
||||||
},
|
|
||||||
'plumgrid': {
|
|
||||||
'src': os.path.join(src_plugins, 'plumgrid'),
|
|
||||||
'dest': '/etc/neutron/plugins/plumgrid',
|
|
||||||
},
|
|
||||||
'ryu': {
|
|
||||||
'src': os.path.join(src_plugins, 'ryu'),
|
|
||||||
'dest': '/etc/neutron/plugins/ryu',
|
|
||||||
},
|
|
||||||
'vmware': {
|
|
||||||
'src': os.path.join(src_plugins, 'vmware'),
|
|
||||||
'dest': '/etc/neutron/plugins/vmware',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for conf, dirs in plugins_configs.iteritems():
|
|
||||||
if os.path.exists(dirs['src']):
|
|
||||||
if os.path.exists(dirs['dest']):
|
|
||||||
shutil.rmtree(dirs['dest'])
|
|
||||||
shutil.copytree(dirs['src'], dirs['dest'])
|
|
||||||
|
|
||||||
src_rootwrap = os.path.join(src_etc, 'neutron/rootwrap.d')
|
|
||||||
rootwrap_configs = {
|
|
||||||
'debug-filters': {
|
|
||||||
'src': os.path.join(src_rootwrap, 'debug.filters'),
|
|
||||||
'dest': '/etc/neutron/rootwrap.d/debug.filters',
|
|
||||||
},
|
|
||||||
'dhcp-filters': {
|
|
||||||
'src': os.path.join(src_rootwrap, 'dhcp.filters'),
|
|
||||||
'dest': '/etc/neutron/rootwrap.d/dhcp.filters',
|
|
||||||
},
|
|
||||||
'ipset-firewall-filters': {
|
|
||||||
'src': os.path.join(src_rootwrap, 'ipset-firewall.filters'),
|
|
||||||
'dest': '/etc/neutron/rootwrap.d/ipset-firewall.filters',
|
|
||||||
},
|
|
||||||
'iptables-firewall-filters': {
|
|
||||||
'src': os.path.join(src_rootwrap, 'iptables-firewall.filters'),
|
|
||||||
'dest': '/etc/neutron/rootwrap.d/iptables-firewall.filters',
|
|
||||||
},
|
|
||||||
'l3-filters': {
|
|
||||||
'src': os.path.join(src_rootwrap, 'l3.filters'),
|
|
||||||
'dest': '/etc/neutron/rootwrap.d/l3.filters',
|
|
||||||
},
|
|
||||||
'lbaas-haproxy': {
|
|
||||||
'src': os.path.join(src_rootwrap, 'lbaas-haproxy.filters'),
|
|
||||||
'dest': '/etc/neutron/rootwrap.d/lbaas-haproxy.filters',
|
|
||||||
},
|
|
||||||
'linuxbridge-plugin': {
|
|
||||||
'src': os.path.join(src_rootwrap, 'linuxbridge-plugin.filters'),
|
|
||||||
'dest': '/etc/neutron/rootwrap.d/linuxbridge-plugin.filters',
|
|
||||||
},
|
|
||||||
'nec-plugin': {
|
|
||||||
'src': os.path.join(src_rootwrap, 'nec-plugin.filters'),
|
|
||||||
'dest': '/etc/neutron/rootwrap.d/nec-plugin.filters',
|
|
||||||
},
|
|
||||||
'openvswitch-plugin': {
|
|
||||||
'src': os.path.join(src_rootwrap, 'openvswitch-plugin.filters'),
|
|
||||||
'dest': '/etc/neutron/rootwrap.d/openvswitch-plugin.filters',
|
|
||||||
},
|
|
||||||
'ryu-plugin': {
|
|
||||||
'src': os.path.join(src_rootwrap, 'ryu-plugin.filters'),
|
|
||||||
'dest': '/etc/neutron/rootwrap.d/ryu-plugin.filters',
|
|
||||||
},
|
|
||||||
'vpnaas': {
|
|
||||||
'src': os.path.join(src_rootwrap, 'vpnaas.filters'),
|
|
||||||
'dest': '/etc/neutron/rootwrap.d/vpnaas.filters',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for conf, files in rootwrap_configs.iteritems():
|
|
||||||
if os.path.exists(files['src']):
|
|
||||||
shutil.copyfile(files['src'], files['dest'])
|
|
||||||
|
|
||||||
symlinks = [
|
symlinks = [
|
||||||
{'src': '/usr/local/bin/neutron-rootwrap',
|
{'src': '/usr/local/bin/neutron-rootwrap',
|
||||||
|
@ -792,60 +792,11 @@ class TestQuantumAgentReallocation(CharmTestCase):
|
|||||||
join.return_value = 'joined-string'
|
join.return_value = 'joined-string'
|
||||||
quantum_utils.git_post_install(projects_yaml)
|
quantum_utils.git_post_install(projects_yaml)
|
||||||
expected = [
|
expected = [
|
||||||
call('joined-string', '/etc/neutron/api-paste.ini'),
|
call('joined-string', '/etc/neutron'),
|
||||||
call('joined-string', '/etc/neutron/dhcp_agent.ini'),
|
call('joined-string', '/etc/neutron/plugins'),
|
||||||
call('joined-string', '/etc/neutron/fwaas_driver.ini'),
|
call('joined-string', '/etc/neutron/rootwrap.d'),
|
||||||
call('joined-string', '/etc/neutron/l3_agent.ini'),
|
|
||||||
call('joined-string', '/etc/neutron/lbaas_agent.ini'),
|
|
||||||
call('joined-string', '/etc/neutron/metadata_agent.ini'),
|
|
||||||
call('joined-string', '/etc/neutron/metering_agent.ini'),
|
|
||||||
call('joined-string', '/etc/neutron/policy.json'),
|
|
||||||
call('joined-string', '/etc/neutron/rootwrap.conf'),
|
|
||||||
call('joined-string', '/etc/neutron/vpn_agent.ini'),
|
|
||||||
]
|
]
|
||||||
copyfile.assert_has_calls(expected, any_order=True)
|
copytree.assert_has_calls(expected)
|
||||||
expected = [
|
|
||||||
call('joined-string', '/etc/neutron/plugins/bigswitch'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/brocade'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/cisco'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/hyperv'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/ibm'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/metaplugin'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/midonet'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/ml2'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/mlnx'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/nec'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/nuage'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/oneconvergence'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/opencontrail'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/plumgrid'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/ryu'),
|
|
||||||
call('joined-string', '/etc/neutron/plugins/vmware'),
|
|
||||||
]
|
|
||||||
copytree.assert_has_calls(expected, any_order=True)
|
|
||||||
expected = [
|
|
||||||
call('joined-string',
|
|
||||||
'/etc/neutron/rootwrap.d/dhcp.filters'),
|
|
||||||
call('joined-string',
|
|
||||||
'/etc/neutron/rootwrap.d/ipset-firewall.filters'),
|
|
||||||
call('joined-string',
|
|
||||||
'/etc/neutron/rootwrap.d/iptables-firewall.filters'),
|
|
||||||
call('joined-string',
|
|
||||||
'/etc/neutron/rootwrap.d/l3.filters'),
|
|
||||||
call('joined-string',
|
|
||||||
'/etc/neutron/rootwrap.d/lbaas-haproxy.filters'),
|
|
||||||
call('joined-string',
|
|
||||||
'/etc/neutron/rootwrap.d/linuxbridge-plugin.filters'),
|
|
||||||
call('joined-string',
|
|
||||||
'/etc/neutron/rootwrap.d/nec-plugin.filters'),
|
|
||||||
call('joined-string',
|
|
||||||
'/etc/neutron/rootwrap.d/openvswitch-plugin.filters'),
|
|
||||||
call('joined-string',
|
|
||||||
'/etc/neutron/rootwrap.d/ryu-plugin.filters'),
|
|
||||||
call('joined-string',
|
|
||||||
'/etc/neutron/rootwrap.d/vpnaas.filters'),
|
|
||||||
]
|
|
||||||
copyfile.assert_has_calls(expected, any_order=True)
|
|
||||||
expected = [
|
expected = [
|
||||||
call('/usr/local/bin/neutron-rootwrap',
|
call('/usr/local/bin/neutron-rootwrap',
|
||||||
'/usr/bin/neutron-rootwrap'),
|
'/usr/bin/neutron-rootwrap'),
|
||||||
|
Loading…
Reference in New Issue
Block a user